home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 3 / csmp-digest-v3-117 < prev    next >
Text File  |  1995-12-31  |  102KB  |  2,775 lines

  1. C.S.M.P. Digest             Sat, 21 Oct 95       Volume 3 : Issue 117
  2.  
  3. Today's Topics:
  4.  
  5.         Can I use my own values in the windowKind field?
  6.         Changing monitor resolution on the fly.
  7.         Confessions of an LDEF writer
  8.         Drag Mgr. Question: Confining drags to a window
  9.         Drag and drop on Finder aliases
  10.         Find vertical extent of call to TextBox?
  11.         Gestalt Selectors List 3.1
  12.         Help with UniversalProcPtrs
  13.         How to detect if the cap-lock is on?
  14.         How to tell if a volume is busy ?
  15.         Killed By Update Events (again)
  16.         Making TextEdit field a one-liner
  17.         MixedMode Manager Routine Descriptors for SetDialogItem calls?
  18.         Photoshop Filter Host?
  19.         PowerPC handling of preloaded CODE resources?
  20.         Printing a Hairline?
  21.         [FAQ?] Saving GWorld to PICT...
  22.         [Q] How to use SetDialogTracksCursor()
  23.  
  24.  
  25.  
  26. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  27. (pottier@clipper.ens.fr).
  28.  
  29. The digest is a collection of article threads from the internet newsgroups
  30. comp.sys.mac.programmer.help, csmp.tools and csmp.misc. It is designed for
  31. people who read news semi-regularly and want an archive of the discussions.
  32. If you don't know what a newsgroup is, you probably don't have access to
  33. it. Ask your systems administrator(s) for details. If you don't have access
  34. to news, you may still be able to post messages to the group by using a
  35. mail server like anon.penet.fi (mail help@anon.penet.fi for more
  36. information).
  37.  
  38. Each issue of the digest contains one or more sets of articles (called
  39. threads), with each set corresponding to a 'discussion' of a particular
  40. subject.  The articles are not edited; all articles included in this digest
  41. are in their original posted form (as received by our news server at
  42. nef.ens.fr).  Article threads are not added to the digest until the last
  43. article added to the thread is at least two weeks old (this is to ensure that
  44. the thread is dead before adding it to the digest).  Article threads that
  45. consist of only one message are generally not included in the digest.
  46.  
  47. The digest is officially distributed by two means, by email and ftp.
  48.  
  49. If you want to receive the digest by mail, send email to listserv@ens.fr
  50. with no subject and one of the following commands as body:
  51.     help                                Sends you a summary of commands
  52.     subscribe csmp-digest Your Name     Adds you to the mailing list
  53.     signoff csmp-digest                 Removes you from the list
  54. Once you have subscribed, you will automatically receive each new
  55. issue as it is created.
  56.  
  57. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  58. Questions related to the ftp site should be directed to
  59. scott.silver@dartmouth.edu.
  60.  
  61. -------------------------------------------------------
  62.  
  63. >From cwatson@cam.org (Chris Watson)
  64. Subject: Can I use my own values in the windowKind field?
  65. Date: Sun, 24 Sep 1995 21:04:41 -0400
  66. Organization: Communications Accessibles Montreal, Quebec Canada
  67.  
  68. The subject says about everything... Can I use my own value in the
  69. windowKind field of the WindowRecord?  I'd like to do this so I know what
  70. kind of window I'm dealing with.
  71.  
  72. Inside Mac says (NIM:Macintosh ToolBox Essentials, 4-67) "This field can
  73. contain one of two constants: dialogKind or userKind".  It also states,
  74. "The value userKind represents a window created by your application."  I
  75. am led to conclude that I cannot use my own values here.
  76.  
  77. I saw a thread not long ago discussing this, but saw conflicting answers. 
  78. I know I can't use negatives (those are for DAs) and I can't use
  79. dialogKind (2) or userKind (8)... How about all those other numbers?  Such
  80. as those above 8.
  81.  
  82. Thanks for any help!
  83.  
  84. =====================================================================
  85. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  86.   H H      |                   |                                       |
  87.   | |      | Sean McBride      |                                       |
  88. H-C-C-O-H  | cwatson@cam.org   |   "Total destructive interference"    |
  89.   | |      | Montreal, Canada  |                                       |
  90.   H H      |                   |                                       |
  91. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  92.  
  93. +++++++++++++++++++++++++++
  94.  
  95. >From Francois-Regis.Degott@imag.fr (F. Degott)
  96. Date: 25 Sep 1995 09:23:49 GMT
  97. Organization: LMC-IMAG Grenoble France
  98.  
  99. In article <cwatson-2409952104410001@cwatson.hip.cam.org>, cwatson@cam.org
  100. (Chris Watson) wrote:
  101.  
  102. >The subject says about everything... Can I use my own value in the
  103. >windowKind field of the WindowRecord?  I'd like to do this so I know what
  104. >kind of window I'm dealing with.
  105. >Inside Mac says (NIM:Macintosh ToolBox Essentials, 4-67) "This field can
  106. >contain one of two constants: dialogKind or userKind".  It also states,
  107. >"The value userKind represents a window created by your application."  I
  108. >am led to conclude that I cannot use my own values here.
  109. >I saw a thread not long ago discussing this, but saw conflicting answers. 
  110. >I know I can't use negatives (those are for DAs) and I can't use
  111. >dialogKind (2) or userKind (8)... How about all those other numbers?  Such
  112. >as those above 8.
  113.  
  114. Hi Sean,
  115. i've never tried to modify the windowKind field of a WindowRecord.
  116. The usual way to specify the kind of window is to
  117. use the refCon field, reserved for that, and presents in the
  118. NewWindow (or NewCWindow, ...) parameter list.
  119.  
  120. HTH
  121. Fr
  122. - -------------------------------------------------------------------------------------
  123. FR Degott (Francois-Regis.Degott@imag.fr)
  124. LogiMath, Lab. LMC-IMAG - Grenoble - France
  125. - -------------------------------------------------------------------------------------
  126.  
  127. +++++++++++++++++++++++++++
  128.  
  129. >From dstone@chem.utoronto.ca (David Stone)
  130. Date: Mon, 25 Sep 1995 13:33:44 GMT
  131. Organization: University of Toronto Chemistry
  132.  
  133. In article <cwatson-2409952104410001@cwatson.hip.cam.org>, cwatson@cam.org
  134. (Chris Watson) wrote:
  135. > The subject says about everything... Can I use my own value in the
  136. > windowKind field of the WindowRecord?  I'd like to do this so I know what
  137. > kind of window I'm dealing with.
  138. > Inside Mac says (NIM:Macintosh ToolBox Essentials, 4-67) "This field can
  139. > contain one of two constants: dialogKind or userKind".  It also states,
  140. > "The value userKind represents a window created by your application."  I
  141. > am led to conclude that I cannot use my own values here.
  142. > I saw a thread not long ago discussing this, but saw conflicting answers. 
  143. > I know I can't use negatives (those are for DAs) and I can't use
  144. > dialogKind (2) or userKind (8)... How about all those other numbers?  Such
  145. > as those above 8.
  146.  
  147. In the TCL (at least version 1.x.x) the window's refCon was used to store
  148. a copy of the window object's handle while the windowKind field was
  149. set to 'CW' or something like that (ie a short) so that the TCL-based
  150. application would "know" which windows were objects and which were not.
  151.  
  152. So I guess you can use it - say 'MW' for "my window", freeing up the
  153. refCon field for a handle or pointer, but it's probably not recommended
  154. - the usual disclaimer about undocumented uses not being guaranteed to
  155. work with future OS changes etc....
  156.  
  157. Dave Stone
  158.  
  159. +++++++++++++++++++++++++++
  160.  
  161. >From brians@pbcomputing.com (Brian Stern)
  162. Date: 25 Sep 1995 13:46:05 GMT
  163. Organization: The University of Texas at Austin, Austin, Texas
  164.  
  165. In article <cwatson-2409952104410001@cwatson.hip.cam.org>, cwatson@cam.org
  166. (Chris Watson) wrote:
  167.  
  168. <The subject says about everything... Can I use my own value in the
  169. <windowKind field of the WindowRecord?  I'd like to do this so I know what
  170. <kind of window I'm dealing with.
  171. <
  172. <Inside Mac says (NIM:Macintosh ToolBox Essentials, 4-67) "This field can
  173. <contain one of two constants: dialogKind or userKind".  It also states,
  174. <"The value userKind represents a window created by your application."  I
  175. <am led to conclude that I cannot use my own values here.
  176. <
  177. <I saw a thread not long ago discussing this, but saw conflicting answers. 
  178. <I know I can't use negatives (those are for DAs) and I can't use
  179. <dialogKind (2) or userKind (8)... How about all those other numbers?  Such
  180. <as those above 8.
  181. <
  182. <Thanks for any help!
  183. <
  184. <=====================================================================
  185. <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  186. <  H H      |                   |                                       |
  187. <  | |      | Sean McBride      |                                       |
  188. <H-C-C-O-H  | cwatson@cam.org   |   "Total destructive interference"    |
  189. <  | |      | Montreal, Canada  |                                       |
  190. <  H H      |                   |                                       |
  191. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  192.  
  193. Yes Sean.  You can place any value above 8 in the windowKind field in your
  194. custom document windows.
  195.  
  196. ____________________________________________________________________
  197. Brian  Stern  {8-{)}                          BrianS@pbcomputing.com
  198. Toolbox commando and Menu bard.             Will FlushCache for Cash
  199. INIT Writing FAQ etc. at <ftp://ftp.pbcomputing.com//Guests/BrianS/>
  200.  
  201. +++++++++++++++++++++++++++
  202.  
  203. >From jelemans@aurora-net.com (john elemans)
  204. Date: 25 Sep 1995 18:07:08 GMT
  205. Organization: hundred peaches inc
  206.  
  207. Francios' suggestion is okay, except if you are using the refcon for
  208. something else. In that case it is fine to set the windowkind to what ever 
  209. you like.
  210.  
  211. I use the Window kind to hold a code and then use the refcon for
  212. an object handle (using think c). This way I can check the window
  213. kind and know what the class of the object which created the
  214. window. Then I can coerce the refcon to the right class and
  215. use the object to perform the window operations.
  216.  
  217. je
  218.  
  219. In article <Francois-Regis.Degott-2509951023250001@harpie.imag.fr>,
  220. Francois-Regis.Degott@imag.fr (F. Degott) wrote:
  221.  
  222. > In article <cwatson-2409952104410001@cwatson.hip.cam.org>, cwatson@cam.org
  223. > (Chris Watson) wrote:
  224. > >The subject says about everything... Can I use my own value in the
  225. > >windowKind field of the WindowRecord?  I'd like to do this so I know what
  226. > >kind of window I'm dealing with.
  227. > >Inside Mac says (NIM:Macintosh ToolBox Essentials, 4-67) "This field can
  228. > >contain one of two constants: dialogKind or userKind".  It also states,
  229. > >"The value userKind represents a window created by your application."  I
  230. > >am led to conclude that I cannot use my own values here.
  231. > >I saw a thread not long ago discussing this, but saw conflicting answers. 
  232. > >I know I can't use negatives (those are for DAs) and I can't use
  233. > >dialogKind (2) or userKind (8)... How about all those other numbers?  Such
  234. > >as those above 8.
  235. > Hi Sean,
  236. > i've never tried to modify the windowKind field of a WindowRecord.
  237. > The usual way to specify the kind of window is to
  238. > use the refCon field, reserved for that, and presents in the
  239. > NewWindow (or NewCWindow, ...) parameter list.
  240. > HTH
  241. > Fr
  242. >
  243. - -------------------------------------------------------------------------------------
  244. > FR Degott (Francois-Regis.Degott@imag.fr)
  245. > LogiMath, Lab. LMC-IMAG - Grenoble - France
  246. >
  247. - -------------------------------------------------------------------------------------
  248.  
  249. +++++++++++++++++++++++++++
  250.  
  251. >From ola.berg@digit.se (Ola Berg)
  252. Date: 25 Sep 1995 20:18:09 GMT
  253. Organization: Digit
  254.  
  255. In article <cwatson-2409952104410001@cwatson.hip.cam.org>, cwatson@cam.org
  256. (Chris Watson) wrote:
  257.  
  258. >The subject says about everything... Can I use my own value in the
  259. >windowKind field of the WindowRecord?  I'd like to do this so I know what
  260. >kind of window I'm dealing with.
  261. >Inside Mac says (NIM:Macintosh ToolBox Essentials, 4-67) "This field can
  262. >contain one of two constants: dialogKind or userKind".  It also states,
  263. >"The value userKind represents a window created by your application."  I
  264. >am led to conclude that I cannot use my own values here.
  265. >I saw a thread not long ago discussing this, but saw conflicting answers. 
  266. >I know I can't use negatives (those are for DAs) and I can't use
  267. >dialogKind (2) or userKind (8)... How about all those other numbers?  Such
  268. >as those above 8.
  269.  
  270. Do not change windowKind. It is good to have when mac is separating dlogs
  271. from winds.
  272.  
  273. Use SetRefCon( WindowPtr, long refcon)
  274.  
  275. and
  276.  
  277. long refcon = GetRefCon( WindowPtr) instead!
  278.  
  279. With GetWVariation() you also get wich kind of window defproc that you are
  280. using. It is good for handling the size-box. I think. Email me if that is
  281. stupid cos I rely on this everytime!
  282.  
  283.  
  284. Yours in HIM
  285.  
  286. <ichtys>< 
  287.  
  288. Ola
  289. ola.berg@digit.se
  290.  
  291. +++++++++++++++++++++++++++
  292.  
  293. >From brians@pbcomputing.com (Brian Stern)
  294. Date: 26 Sep 1995 03:17:55 GMT
  295. Organization: The University of Texas at Austin, Austin, Texas
  296.  
  297. In article <jelemans-2509951105060001@port16.annex1.disc-net.com>,
  298. jelemans@aurora-net.com (john elemans) wrote:
  299.  
  300. <Francios' suggestion is okay, except if you are using the refcon for
  301. <something else. In that case it is fine to set the windowkind to what ever 
  302. <you like.
  303. <
  304. <I use the Window kind to hold a code and then use the refcon for
  305. <an object handle (using think c). This way I can check the window
  306. <kind and know what the class of the object which created the
  307. <window. Then I can coerce the refcon to the right class and
  308. <use the object to perform the window operations.
  309. <
  310.  
  311. Exactamundo.
  312.  
  313. Let me quote from IM I.
  314.  
  315. [It mentions that the windowKind field may be negative, 2 or 8.]
  316.  
  317. "UserKind represents a window created directly by application calls to the
  318. Window Manager; for such windows the application can in fact set the
  319. window class to any value greter than 8 if desired."
  320.  
  321. ____________________________________________________________________
  322. Brian  Stern  {8-{)}                          BrianS@pbcomputing.com
  323. Toolbox commando and Menu bard.             Will FlushCache for Cash
  324. INIT Writing FAQ etc. at <ftp://ftp.pbcomputing.com//Guests/BrianS/>
  325.  
  326. +++++++++++++++++++++++++++
  327.  
  328. >From jordanz@altura.com (Jordan Zimmerman)
  329. Date: Tue, 26 Sep 1995 10:03:44 -0800
  330. Organization: Altura Software, Inc.
  331.  
  332. > The subject says about everything... Can I use my own value in the
  333. > windowKind field of the WindowRecord?  I'd like to do this so I know what
  334. > kind of window I'm dealing with.
  335. > Inside Mac says (NIM:Macintosh ToolBox Essentials, 4-67) "This field can
  336. > contain one of two constants: dialogKind or userKind".  It also states,
  337. > "The value userKind represents a window created by your application."  I
  338. > am led to conclude that I cannot use my own values here.
  339. > I saw a thread not long ago discussing this, but saw conflicting answers. 
  340. > I know I can't use negatives (those are for DAs) and I can't use
  341. > dialogKind (2) or userKind (8)... How about all those other numbers?  Such
  342. > as those above 8.
  343.  
  344. I think it's safe to use any positive number for windowKind. However, I
  345. believe dialogs must have dialogKind.
  346.  
  347. -- 
  348. Jordan Zimmerman, Altura Software
  349. home page: http://www.altura.com/jordanz/home.html
  350. Coming to you fast as lightning on a 9500/120!
  351.  
  352. +++++++++++++++++++++++++++
  353.  
  354. >From cwatson@cam.org (Chris Watson)
  355. Date: Tue, 26 Sep 1995 12:53:37 -0400
  356. Organization: Communications Accessibles Montreal, Quebec Canada
  357.  
  358. In article <brians-2509952215580001@slip-4-9.ots.utexas.edu>,
  359. brians@pbcomputing.com (Brian Stern) wrote:
  360.  
  361. > "UserKind represents a window created directly by application calls to the
  362. > Window Manager; for such windows the application can in fact set the
  363. > window class to any value greter than 8 if desired."
  364.  
  365. Well, there have been lots of replies to my orignal post and almost all of
  366. them have completely different answers, but, for me this settles it... I
  367. wonder why this little tidbit of information appears no where in New
  368. Inside Mac (that I've found anyway)
  369.  
  370. Thanks to all for helping out!  It is truely appreciated!
  371.  
  372. =====================================================================
  373. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  374.   H H      |                   |                                       |
  375.   | |      | Sean McBride      |                                       |
  376. H-C-C-O-H  | cwatson@cam.org   |   "Total destructive interference"    |
  377.   | |      | Montreal, Canada  |                                       |
  378.   H H      |                   |                                       |
  379. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  380.  
  381. +++++++++++++++++++++++++++
  382.  
  383. >From peter@adi.co.nz (Peter Bromley)
  384. Date: Fri, 29 Sep 1995 16:51:36 +1200
  385. Organization: ADInstruments
  386.  
  387. In article <cwatson-2609951253370001@cwatson.hip.cam.org>, cwatson@cam.org
  388. (Chris Watson) wrote:
  389.  
  390. > In article <brians-2509952215580001@slip-4-9.ots.utexas.edu>,
  391. > brians@pbcomputing.com (Brian Stern) wrote:
  392. > > "UserKind represents a window created directly by application calls to the
  393. > > Window Manager; for such windows the application can in fact set the
  394. > > window class to any value greter than 8 if desired."
  395. > Well, there have been lots of replies to my orignal post and almost all of
  396. > them have completely different answers, but, for me this settles it... I
  397. > wonder why this little tidbit of information appears no where in New
  398. > Inside Mac (that I've found anyway)
  399. > Thanks to all for helping out!  It is truely appreciated!
  400.  
  401.  
  402. What I find interesting is that this 'little titbit of information' didnt
  403. make the jump from IM to NIM. Does this indicate a hidden agenda on Apples
  404. behalf ;-)
  405. MAYBE the windowKind will quietly disappear some time soon (did I hear
  406. someone say Copland?).
  407.  
  408. -- 
  409. -
  410. Peter Bromley                                  (peter@adi.co.nz)
  411. ADInstruments, Dunedin, New Zealand            
  412.  
  413. +++++++++++++++++++++++++++
  414.  
  415. >From cwatson@cam.org (Chris Watson)
  416. Date: Sun, 01 Oct 1995 14:07:28 -0400
  417. Organization: Communications Accessibles Montreal, Quebec Canada
  418.  
  419. In article <peter-2909951651360001@adi008.adi.co.nz>, peter@adi.co.nz
  420. (Peter Bromley) wrote:
  421.  
  422. > What I find interesting is that this 'little titbit of information' didn't
  423. > make the jump from IM to NIM. Does this indicate a hidden agenda on Apples
  424. > behalf ;-)
  425. > MAYBE the windowKind will quietly disappear some time soon (did I hear
  426. > someone say Copland?).
  427.  
  428. Perhaps, but I just finsihed changing my code to make use of the
  429. windowKind field and everything does work as before....
  430.  
  431. BTW, Windows.h does have a SetWindowKind () so at least it seems that we
  432. are allowed to use it for the time being...
  433.  
  434.  
  435. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  436.   H H      |                   |                                       |
  437.   | |      | Sean McBride      |                                       |
  438. H-C-C-O-H  | cwatson@cam.org   |   "Total destructive interference"    |
  439.   | |      | Montreal, Canada  |                                       |
  440.   H H      |                   |                                       |
  441. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  442.  
  443. ---------------------------
  444.  
  445. >From summeral@rintintin.Colorado.EDU (Summerall  Thomas G)
  446. Subject: Changing monitor resolution on the fly.
  447. Date: 2 Oct 95 19:21:34 GMT
  448. Organization: University of Colorado at Boulder
  449.  
  450. I've just discovered that  with a multisync monitor and the appropriate
  451. adapter, PowerMacs can change screen pixel resolution immediately, without
  452. rebooting, via the monitors control panel.  This is a joy because we often
  453. want to be in 640X480 to look at graphics in their final foprm, but then
  454. switch to a higher res for looking at a lot of stuff at once.
  455.  
  456. So, my question is, how could I find out how the monitors control panel does
  457. this and then implement it in a QuickKey or faceless app?   I can't find
  458. anything about this ability in the device manager documentation.  Is it
  459. documented?   If so where?  If not, does anyone know how to do this?
  460.  
  461. If I figure it out, I'll release it as free/shareware depending on how
  462. difficult it is.
  463.  
  464. Thanks!
  465.  
  466. Tom Summerall
  467.  
  468. +++++++++++++++++++++++++++
  469.  
  470. >From first.ascent@mindlink.bc.ca (Alex Curylo)
  471. Date: 4 Oct 1995 01:01:21 GMT
  472. Organization: First Ascent
  473.  
  474. In article <summeral.812661694@rintintin.Colorado.EDU>
  475. summeral@rintintin.Colorado.EDU (Summerall  Thomas G) writes:
  476.  
  477. > So, my question is, how could I find out how the monitors control panel does
  478. > this and then implement it in a QuickKey or faceless app?   I can't find
  479. > anything about this ability in the device manager documentation.  Is it
  480. > documented?   If so where?  If not, does anyone know how to do this?
  481.  
  482. Yes. It's in the QuickTime 2.1 API.
  483.  
  484.  
  485. Alex Curylo  first.ascent@mindlink.bc.ca  (604)451-5323, fax -1359
  486. ***  First Ascent: Mac programming, UP paragliders, indie CDs  ***
  487.  
  488. ---------------------------
  489.  
  490. >From bullfrog@pulm1.accessone.com (Thomas L. Perry)
  491. Subject: Confessions of an LDEF writer
  492. Date: 30 Sep 1995 18:25:51 GMT
  493. Organization: Bullfrog Software Engineering
  494.  
  495.     On a recent project I decided that it was time to give all my
  496. dialogs that gun metal grey slick 3D interface that seems to be very
  497. popular these days. The first part of this task, was to change the
  498. dialog background color to grey. That was trivial, however, it
  499. introduced some new, and not completely unexpected problems (as I have
  500. read from others in this newsgroup a few times). 
  501.     The key to this lovely grey interface is that some of the controls
  502. still need to have a white background such as text boxes and scrolling
  503. List boxes. The solution for most of the controls was easy, I simply
  504. changed the 'cctb' for the relevant controls. However, for my
  505. listboxes, the solution was not nearly so convenient (go ahead and
  506. correct me if I'm wrong).
  507.     To get the white fill in the listboxes I had to write my own LDEF
  508. so that I could control the drawing of the listbox background. That
  509. wasn't too tough, I just handle the lDrawMsg and draw a white box
  510. behind each item in the list. So there I had it, problem solved, right?
  511.  
  512.     As I am patting myself on the back and scrolling down my list I
  513. discover that the very last item in the list scrolls upward to reveal
  514. an extra space that I had never allocated. Evidently, and much to my
  515. chagrin, the list manager always adds one more element to your list
  516. than the number that you have explicitly created. Unfortunately, this
  517. extra space at the end is colored grey, and I can't seem to paint it
  518. white.
  519.     The bottom line is that my entire list draws beautifully, white
  520. background and all, with the exception of the very last (empty) cell in
  521. the list which appears grey. It looks pretty lame. How do I paint in
  522. this last cell? Better yet, how can I eliminate this blank and useless
  523. cell at the end of the list?
  524.  
  525. Sigh...
  526. Tom Perry
  527.  
  528. |o|=============================================================|o|
  529. |o|  Bullfrog Software Engineering      206.747.8199 vox        |o|
  530. |o|  12700 N.E. 8th St. #E302           206.747.8299 fax        |o|
  531. |o|  Bellevue, WA 98005                 bullfrog@accessone.com  |o|
  532. |o|=============================================================|o|
  533.  
  534. +++++++++++++++++++++++++++
  535.  
  536. >From ekstrom@aggroup.com (Harold Ekstrom)
  537. Date: Sun, 01 Oct 1995 15:39:15 -0800
  538. Organization: the ag group, inc.
  539.  
  540. Here's an alternative method: For windows that have a lot of white space
  541. in lists or edit fields etc. leave the background color of the window
  542. white and when you update the window make a region for the entire window
  543. minus and items. FillRgn that area gray and then you don't have to do
  544. anything with custom LDEFs or change control color tables.
  545.  
  546. Here's some tradeoffs:
  547.  
  548. gray background color
  549. - items that are mostly white flash gray when they're being updated and
  550.   there's no way to prevent this
  551. - may require some special coding like custom LDEFs
  552. - may require you to set up custom color tables for controls and other
  553.   items
  554.  
  555.  
  556. white background color
  557. - the gray area flashes white while it's being updated (I think this is
  558.   less annoying than other areas flashing gray partly because the white
  559.   areas contain items that are probably the focus of the user's
  560.   attention)
  561. - requires you to be able to find all the items in the window and
  562.   subtract them from a region to update the gray area (this may be easy
  563.   if you can walk a simple list of items such as the DITL for a dialog)
  564. - dialogs have a 3 pixel area around the edges that you cannot draw in
  565.   and that is updated in the background color of the window (why the
  566.   hell did they ever do that anyway?)
  567.  
  568. Overall I prefer the white background approach. The visual effect is more
  569. pleasing and the gray area draws smoothly in one step without repainting.
  570.  
  571. -harold
  572.  
  573. - ------------------------------------------------------------
  574. Harold Ekstrom
  575. ekstrom@aggroup.com
  576. ag group, inc.
  577. 2540 camino diablo, suite 200
  578. walnut creek, ca 94596
  579. 510-937-7900 voice
  580. 510-937-2479 fax
  581. 510-937-6704 ara
  582. ftp.aggroup.com anonymous ftp
  583.  
  584.  
  585. ---------------------------
  586.  
  587. >From David Reiss <reiss@astro.washington.edu>
  588. Subject: Drag Mgr. Question: Confining drags to a window
  589. Date: 29 Sep 1995 00:33:41 GMT
  590. Organization: http://www.astro.washington.edu
  591.  
  592. Hi.  I am trying to write a DragTrackingHandler routine to confine
  593. a drag within a window, much as the Drag Manager documentation suggests
  594. you can do when it describes the 'SetDragMouse' routine.  It works
  595. fine when the drag is over a window owned by my application, but
  596. since my tracking handler doesn't get called when its over another
  597. app, or over a finder window, the drag doesn't get confined in these
  598. cases.  Does anyone know of a way to make SURE the drag is always within
  599. my window, even when the cursor is NOT over a window from my application?
  600. I suppose I could write a drag-drawing hook and use that, but then
  601. I have to deal with the drag region drawing as well.  I'd prefer
  602. to avoid that.  Thanks in advance for any -- and I mean any -- ideas!!!
  603.  
  604. -David Reiss
  605. reiss@astro.washington.edu
  606.  
  607.  
  608. +++++++++++++++++++++++++++
  609.  
  610. >From awiner@oracle.com (Adam Winer)
  611. Date: Thu, 28 Sep 1995 21:51:52 -0800
  612. Organization: Oracle Corporation
  613.  
  614. In article <44fet5$edq@nntp5.u.washington.edu>, David Reiss
  615. <reiss@astro.washington.edu> wrote:
  616.  
  617. > Hi.  I am trying to write a DragTrackingHandler routine to confine
  618. > a drag within a window, much as the Drag Manager documentation suggests
  619. > you can do when it describes the 'SetDragMouse' routine.  It works
  620. > fine when the drag is over a window owned by my application, but
  621. > since my tracking handler doesn't get called when its over another
  622. > app, or over a finder window, the drag doesn't get confined in these
  623. > cases.  Does anyone know of a way to make SURE the drag is always within
  624. > my window, even when the cursor is NOT over a window from my application?
  625. > I suppose I could write a drag-drawing hook and use that, but then
  626. > I have to deal with the drag region drawing as well.  I'd prefer
  627. > to avoid that.  Thanks in advance for any -- and I mean any -- ideas!!!
  628.  
  629. When you call AddDragItemFlavor, use the flavorSendOnly flag.  However,
  630. it may just be easiest to blow off the Drag Manager and use
  631. DragGrayRgn, since the Drag Manager isn't doing a whole lot for
  632. you in this case.
  633.  
  634. -- Adam Winer
  635. awiner@us.oracle.com
  636.  
  637. +++++++++++++++++++++++++++
  638.  
  639. >From McMath_C@mediasoft.net (Chuck ...E's In Love... McMath)
  640. Date: Fri, 29 Sep 1995 08:28:00 -0500
  641. Organization: Reed Technology & Information Services, Inc.
  642.  
  643. In article <44fet5$edq@nntp5.u.washington.edu>, David Reiss
  644. <reiss@astro.washington.edu> wrote:
  645.  
  646. > Hi.  I am trying to write a DragTrackingHandler routine to confine
  647. > a drag within a window, much as the Drag Manager documentation suggests
  648. > you can do when it describes the 'SetDragMouse' routine.  It works
  649. > fine when the drag is over a window owned by my application, but
  650. > since my tracking handler doesn't get called when its over another
  651. > app, or over a finder window, the drag doesn't get confined in these
  652. > cases.  Does anyone know of a way to make SURE the drag is always within
  653. > my window, even when the cursor is NOT over a window from my application?
  654. > I suppose I could write a drag-drawing hook and use that, but then
  655. > I have to deal with the drag region drawing as well.  I'd prefer
  656. > to avoid that.  Thanks in advance for any -- and I mean any -- ideas!!!
  657. > -David Reiss
  658. > reiss@astro.washington.edu
  659.  
  660. Well, it looks like SetDragMouse will only work in pinning it within your
  661. window.  The documentation doesn't say it'll actually constrict the
  662. cursor, just that it allows you to pin the (proposed) drop location.
  663.  
  664. Can't you do something funky when you get the exitWindow and/or
  665. exitHandler messages?  That's the only thing I can think of offhand.
  666.  
  667. Good luck, and why the heck do you even want to do this?  If it's special
  668. data you can just use a special type, or maybe in your Drop Handler see if
  669. the destination window != the source window and make the drag fail there. 
  670. While that's cheesy, it will have the effect of not allowing a person to
  671. drag something from within your window to outside of it.
  672.  
  673. chuck
  674.  
  675. |-- Chuck McMath -- McMath_C@mediasoft.net -or-- chuck@ocs.com -----|
  676. |-- Reed Technology & Information Services, Inc. -------------------|
  677. |-- 20251 Century Blvd. -- Germantown, MD  20874 -------------------|
  678. |-------------- "Hey Batter, Hey Batter, swing!" - Anon.------------|
  679. |--------------- Jeans by Jordache, Body By Fritos -----------------|
  680.  
  681.  
  682. +++++++++++++++++++++++++++
  683.  
  684. >From Carl R. Osterwald <carl_osterwald@nrel.gov>
  685. Date: 29 Sep 1995 16:48:41 GMT
  686. Organization: National Renewable Energy Laboratory
  687.  
  688. In article <awiner-2809952151520001@awiner-mac2.us.oracle.com> Adam
  689. Winer, awiner@oracle.com writes:
  690.  
  691. >However,
  692. >it may just be easiest to blow off the Drag Manager and use
  693. >DragGrayRgn, since the Drag Manager isn't doing a whole lot for
  694. >you in this case.
  695.  
  696. This is what I do when it doesn't make sense to drag something outside
  697. of a window.  Trying to use the Drag Manager in such a case would be
  698. counter productive because it really wasn't designed for it.  It may
  699. not even be possible.
  700.  
  701. +++++++++++++++++++++++++++
  702.  
  703. >From David Reiss <reiss@astro.washington.edu>
  704. Date: 29 Sep 1995 22:11:43 GMT
  705. Organization: http://www.astro.washington.edu
  706.  
  707. Actually, I just discovered how to do this using the drag manager last
  708. night ( I want to use the drag manager because I already have drag-
  709. response stuff like hilighting, etc. already designed, and I would
  710. have to rewrite it if I were to use DragGrayRgn ).  Anyway, all you
  711. have to do is use a custom DragInputProc routine, which allows you
  712. to set the drag location for any drag originiating in your app, no
  713. matter where the mouse cursor is.  So you just pin the drag location
  714. within your window's rect, and all the drag feedback stuff works
  715. fine.  Thanks for all the tips, but I think I'm gonna use this.  ANd
  716. it works with PowerPlant's drag-and-drop classes too!  
  717.  
  718. -David
  719.  
  720.  
  721. +++++++++++++++++++++++++++
  722.  
  723. >From mouser@zercom.net (Martin-Gilles Lavoie)
  724. Date: Tue, 03 Oct 1995 11:07:33 -0500
  725. Organization: ZERCOM Technologies Inc.
  726.  
  727. In article <44fet5$edq@nntp5.u.washington.edu>, David Reiss
  728. <reiss@astro.washington.edu> wrote:
  729.  
  730. > Hi.  I am trying to write a DragTrackingHandler routine to confine
  731. > a drag within a window, much as the Drag Manager documentation suggests
  732. > you can do when it describes the 'SetDragMouse' routine.  It works
  733. > fine when the drag is over a window owned by my application, but
  734. > since my tracking handler doesn't get called when its over another
  735. > app, or over a finder window, the drag doesn't get confined in these
  736. > cases.  Does anyone know of a way to make SURE the drag is always within
  737. > my window, even when the cursor is NOT over a window from my application?
  738. > I suppose I could write a drag-drawing hook and use that, but then
  739. > I have to deal with the drag region drawing as well.  I'd prefer
  740. > to avoid that.  Thanks in advance for any -- and I mean any -- ideas!!!
  741. > -David Reiss
  742. > reiss@astro.washington.edu
  743.  
  744. A simpler solution (and maybe even more convenient to the user) would be
  745. to use application-specific flavors in your drags, and avoid using
  746. standard flavors that may be used by other applications.  A flavor using
  747. your application creator isn't a bad choice.
  748.  
  749. This would keep the data for yourself, but still allow your user to drop
  750. the data into the Finder trash (thus, erasing the data if you handle this
  751. correctly).
  752.  
  753. On this note, is there a drag flavor registry??  (why couldn't they use
  754. AEs for this...)
  755.  
  756. Martin-Gilles Lavoie
  757.  
  758. - -------------------------------------------------------------------
  759. MPW: Because life is too complicated for CodeWarrior.
  760. --MGL
  761.  
  762. +++++++++++++++++++++++++++
  763.  
  764. >From paustian@facstaff.wisc.edu (Timothy Paustian)
  765. Date: Tue, 03 Oct 1995 12:17:27 -0600
  766. Organization: University of Wisconsin - Madison
  767.  
  768. In article <mouser-0310951107330001@204.191.6.123>, mouser@zercom.net
  769. (Martin-Gilles Lavoie) wrote:
  770. Martin,
  771.  
  772. > On this note, is there a drag flavor registry??  (why couldn't they use
  773. > AEs for this...)
  774.  
  775. Because not all apps accept AppleEvents. Although I guess you could test a
  776. target app for this, but it could get tricky.
  777.  
  778. Tim
  779.  
  780. -- 
  781. Tim Paustian      "Remember past mistakes, don't fear them"         
  782. Department of Bacteriology     
  783. University of Wisconsin-Madison
  784. 1550 Linden Dr.
  785. Madison, WI 53706      Email:   paustian@facstaff.wisc.edu
  786.  
  787. ---------------------------
  788.  
  789. >From heaney@crl.com (John S. Heaney)
  790. Subject: Drag and drop on Finder aliases
  791. Date: 29 Sep 1995 15:45:39 -0700
  792. Organization: CRL Dialup Internet Access        (415) 705-6060  [Login: guest]
  793.  
  794. I'm using System 7.1, but I also noticed this behavior in System 7.0.
  795.  
  796. If I have an alias to an application, such as Resorcerer, that happens to 
  797. be on a separate volume then dragging a file onto the alias does not 
  798. work. It works fine if the alias is on the same volume as the 
  799. application. It's kind of a pain because I like to have my development 
  800. software on one volume and my projects on another. I then put aliases of 
  801. various tools in there with my project.
  802.  
  803. Is there some reason for this behavior and does 7.5 behave this way?
  804.  
  805. BTW, otherwise the alias works fine. I can double-click to launch the 
  806. application.
  807. -- 
  808. John Heaney              Time flies whether you're having fun or not.
  809. heaney@crl.com
  810.  
  811. +++++++++++++++++++++++++++
  812.  
  813. >From jonpugh@netcom.com (Jon Pugh)
  814. Date: Mon, 2 Oct 1995 23:58:55 GMT
  815. Organization: Will hack for food
  816.  
  817. John S. Heaney (heaney@crl.com) wrote:
  818.  
  819. > Is there some reason for this behavior and does 7.5 behave this way?
  820.  
  821. This is a desktop database bug and it's in 7.5 also.  I don't do cross
  822. volume aliases much anymore.  At least not if they involve drag and drop.
  823. It's possible to make an alias on the desktop which is on a volume other
  824. than the startup disk by simply making it in a different folder and dragging
  825. it to the desktop.
  826.  
  827. Jon
  828.  
  829.  
  830. ---------------------------
  831.  
  832. >From neves@ils.nwu.edu (David Neves)
  833. Subject: Find vertical extent of call to TextBox?
  834. Date: Fri, 22 Sep 1995 10:42:35 -0500
  835. Organization: The Institute for the Learning Sciences
  836.  
  837. I would like to know before I make a call to TextBox how much vertical
  838. space the text will take up.  One suggestion I've heard is to make a dummy
  839. call to TextBox and check the pen position as the pen will be positioned
  840. at the end of the text.  Is there something less kludgy?
  841. -Thanks, David
  842.  
  843. +++++++++++++++++++++++++++
  844.  
  845. >From Francois-Regis.Degott@imag.fr (F. Degott)
  846. Date: 25 Sep 1995 15:24:01 GMT
  847. Organization: LMC-IMAG Grenoble France
  848.  
  849. In article <neves-2209951042350001@neves.ils.nwu.edu>, neves@ils.nwu.edu
  850. (David Neves) wrote:
  851.  
  852. >I would like to know before I make a call to TextBox how much vertical
  853. >space the text will take up.  One suggestion I've heard is to make a dummy
  854. >call to TextBox and check the pen position as the pen will be positioned
  855. >at the end of the text.  Is there something less kludgy?
  856.  
  857. Hi David,
  858.  
  859. see the QuickDraw Manager, IM vol.1, p.173.
  860.  
  861. With GetFontInfo(finfo) proc., you get the _one_ line height
  862. in the current font setting (fheight = finfo.ascent+finfo.descent).
  863. Just compute the number of lines represented by your string 
  864. (nlines = (number of CR in string) + 1), and then multiply it by fheight.
  865.  
  866. HTH
  867. Fr
  868. - -------------------------------------------------------------------------------------
  869. FR Degott (Francois-Regis.Degott@imag.fr)
  870. LogiMath, Lab. LMC-IMAG - Grenoble - France
  871. - -------------------------------------------------------------------------------------
  872.  
  873. +++++++++++++++++++++++++++
  874.  
  875. >From geek@nwu.edu (Joey Gray)
  876. Date: Mon, 25 Sep 1995 14:24:08 -0500
  877. Organization: Northwestern University
  878.  
  879. In article <neves-2209951042350001@neves.ils.nwu.edu>, neves@ils.nwu.edu
  880. (David Neves) wrote:
  881.  
  882. >I would like to know before I make a call to TextBox how much vertical
  883. >space the text will take up.  One suggestion I've heard is to make a dummy
  884. >call to TextBox and check the pen position as the pen will be positioned
  885. >at the end of the text.  Is there something less kludgy?
  886.  
  887. is the pen position after a call to TextBox documented to be on the bottom
  888. of the last line of text drawn? i don't think it is, and i would actually
  889. be very surprised if it were. given that, i would never rely on the pen
  890. position to accurately reflect the size of the displayed text.
  891.  
  892. i saw another response to this query that said to use the font information
  893. for the font in use to determine the line height, and then multiply that
  894. by the number of lines in the text - which is determined by the number of
  895. carriage returns in the text. that would work (and be very easy) if your
  896. text already contained all the necessary carriage returns, and each
  897. separate line fit within the rectangle given to TextBox. personally, i
  898. only use TextBox (or something similar) when i have a very long piece of
  899. text that i need wrapped and displayed in a specific rectangle. i'm
  900. assuming that's what you're doing as well.
  901.  
  902. i can think of two different solutions to this problem:
  903.  
  904. first, create a text edit record with the text you need to display and an
  905. extremely tall view/destination (i'm not sure which it should be)
  906. rectangle that has the same width as the rectangle you want to display the
  907. text in. after inserting the text into the text edit handle, you can check
  908. the "nLines" field to determine the number of lines your text will become
  909. when wrapped at the specified horizontal length. then multiply that by the
  910. line height for the font that you're using. don't forget to include the
  911. spaces between each line (the "leading" field of a FontInfo record). this,
  912. of course, has the downfall that you have to create a temporary text edit
  913. record.
  914.  
  915. second, find the source code for NeoTextBox. i think it was featured in a
  916. past develop article, and i know the source code is out there. according
  917. to what i can find on my machine right now, NTB was written by Bryan K.
  918. Ressler. it's basically a replacement for TextBox, and is supposedly quite
  919. a bit faster, and doesn't involve text edit in any way (i think). the
  920. stuff you want from this is the code that determines the line breaks for a
  921. given chunk of text and a fixed horizontal space. the code is very good,
  922. and the copy that i had was pretty well documented.
  923.  
  924. good luck!
  925.  
  926. -joey
  927. =====================================================================
  928. Joey Gray                       | geek@nwu.edu
  929. School of Education             | (708) 467-1704
  930. Northwestern University         +------------------------------------
  931. **Bandwagon disclaimer:         | "Anybody can cook with gas --
  932.    My opinions are mine, not my |  it takes the French to cook with
  933.    employer's. so there!        |  magnets!" - old newsreel
  934. =====================================================================
  935.  
  936. +++++++++++++++++++++++++++
  937.  
  938. >From kenlong@netcom.com (Ken Long)
  939. Date: Wed, 27 Sep 1995 02:53:07 GMT
  940. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  941.  
  942. F. Degott (Francois-Regis.Degott@imag.fr) wrote:
  943. : In article <neves-2209951042350001@neves.ils.nwu.edu>, neves@ils.nwu.edu
  944. : (David Neves) wrote:
  945.  
  946. : >I would like to know before I make a call to TextBox how much vertical
  947. : >space the text will take up.  One suggestion I've heard is to make a dummy
  948. : >call to TextBox and check the pen position as the pen will be positioned
  949. : >at the end of the text.  Is there something less kludgy?
  950.  
  951. : With GetFontInfo(finfo) proc., you get the _one_ line height
  952. : in the current font setting (fheight = finfo.ascent+finfo.descent).
  953. : Just compute the number of lines represented by your string 
  954. : (nlines = (number of CR in string) + 1), and then multiply it by fheight.
  955.  
  956. You don't know how many lines it is because that's controled by thw width 
  957. of the box.  A line of text, regardless of font used, on a screen-wide 
  958. window my be less than one line, but TextBox it into a narrower box and 
  959. it could end up one word per line, with no CR's in the bunch.
  960. If the purpose of finding out the text overall height, once it's drawn in 
  961. a given rectangle, is to adjust the rectangle so that there is a somewhat 
  962. even border around it, then the pen position at the end of the string 
  963. draw is your stable value from which to determine that.  It's the only 
  964. thing that IS at the vertical coordinate you want to know.
  965.  
  966. Is that the purpose of the datum?  If not, what is it?
  967.  
  968. I did an aboutBox that was a string TextBox'd into a narrow rect.  It came 
  969. out one word per line.  I ran it once, saw that the frame around the rect 
  970. needed to come up abot 10 pixels, so I just deducted that from the rect 
  971. b,r coord.  But if you want to do it on the fly, that's different.
  972.  
  973. -Ken-
  974.  
  975. +++++++++++++++++++++++++++
  976.  
  977. >From ekstrom@aggroup.com (Harold Ekstrom)
  978. Date: Wed, 27 Sep 1995 11:19:40 -0800
  979. Organization: the ag group, inc.
  980.  
  981. Here's one way of doing it:
  982.  
  983.     theTextEditH = TENew( &theTextRect, &theTextRect );
  984.     TESetText( &theString[1], StrLength(theString), theTextEditH );
  985.     theTextHeight = (**theTextEditH).lineHeight * (**theTextEditH).nLines;
  986.     TEDispose( theTextEditH );
  987.  
  988. Since TextBox draws its text this way, this should calculate the exact
  989. height that TextBox requires. It's not exactly fast though. If you're
  990. worried about speed you could do better by calculating line breaks
  991. yourself using StyledLineBreak.
  992.  
  993. -harold
  994.  
  995. - ------------------------------------------------------------
  996. Harold Ekstrom
  997. ekstrom@aggroup.com
  998. ag group, inc.
  999. 2540 camino diablo, suite 200
  1000. walnut creek, ca 94596
  1001. 510-937-7900 voice
  1002. 510-937-2479 fax
  1003. 510-937-6704 ara
  1004. ftp.aggroup.com anonymous ftp
  1005.  
  1006. +++++++++++++++++++++++++++
  1007.  
  1008. >From mouser@zercom.net (Martin-Gilles Lavoie)
  1009. Date: Wed, 04 Oct 1995 08:33:26 -0500
  1010. Organization: ZERCOM Technologies Inc.
  1011.  
  1012. In article <Francois-Regis.Degott-2509951623380001@harpie.imag.fr>,
  1013. Francois-Regis.Degott@imag.fr (F. Degott) wrote:
  1014.  
  1015. > In article <neves-2209951042350001@neves.ils.nwu.edu>, neves@ils.nwu.edu
  1016. > (David Neves) wrote:
  1017. > >I would like to know before I make a call to TextBox how much vertical
  1018. > >space the text will take up.  One suggestion I've heard is to make a dummy
  1019. > >call to TextBox and check the pen position as the pen will be positioned
  1020. > >at the end of the text.  Is there something less kludgy?
  1021. > Hi David,
  1022. > see the QuickDraw Manager, IM vol.1, p.173.
  1023. > With GetFontInfo(finfo) proc., you get the _one_ line height
  1024. > in the current font setting (fheight = finfo.ascent+finfo.descent).
  1025. > Just compute the number of lines represented by your string 
  1026. > (nlines = (number of CR in string) + 1), and then multiply it by fheight.
  1027. > HTH
  1028. > Fr
  1029.  
  1030. NOT.
  1031.  
  1032. Actually, it's a little more complicated than that.  You have to take into
  1033. account word-wrapping.  If text gets wrapped, you increase the height of
  1034. the text to be draw.
  1035.  
  1036. David Neves: I dont have the answer to your question, though.  But, make
  1037. sure that you wont get word-wrapping before using the fore-mentioned
  1038. technique, using GetFontInfo.
  1039.  
  1040. Martin-Gilles Lavoie
  1041.  
  1042. - -------------------------------------------------------------------
  1043. MPW: Because life is too complicated for CodeWarrior.
  1044. --MGL
  1045.  
  1046. ---------------------------
  1047.  
  1048. >From rgaros@bio.vu.nl (Rene G.A. Ros)
  1049. Subject: Gestalt Selectors List 3.1
  1050. Date: 2 Oct 1995 19:25:15 +0100
  1051. Organization: VU Biology, Amsterdam, The Netherlands
  1052.  
  1053.  
  1054. Dear Mac-programmers,
  1055.  
  1056.  
  1057. Today I released version 3.1 of the
  1058.  
  1059.  
  1060.                        Gestalt Selectors List (GSL)
  1061.  
  1062.  
  1063. It lists all sorts of information about the Gestalt Manager, but mainly
  1064. about selectors and the meaning of the returned values.
  1065. The Gestalt Manager is part of the Apple Macintosh System Software to
  1066. enable programmers to determine the availability of certain software and
  1067. hardware.
  1068.  
  1069. *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  1070. This release marks the third anniversary of the Gestalt Selectors List.
  1071. Many thanks to all the people who provided information: Marco Piovanelli,
  1072. John Mancino and Marc Schrier to name a few.
  1073. Also, many thanks to Jos van Wezel (Computer Dept., Faculty of Biology,
  1074. Vrije Universiteit) for all his help with the mailing list and WWW server!
  1075.  
  1076. Please fill in the survey questionnaire included with the GSL 3.1 archive!
  1077. WWW Users can also enter a survey form via the GSL Home page at
  1078.   http://www.bio.vu.nl/home/rgaros/gestalt/
  1079. *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  1080.  
  1081. You can obtain the latest version in several ways:
  1082. - by sending email to the mail archive server at:
  1083.       gestalt-selectors-list-request@bio.vu.nl
  1084.   with the subject:
  1085.       archive get recent/gestalt-selectors.etx
  1086.   or to get the compressed version:
  1087.       archive get recent/gestalt-selectors.sit.hqx
  1088.  
  1089. - FTP to the info-mac archives at sumex-aim.stanford.edu and get the file
  1090.       /info-mac/dev/info/gestalt-selectors-xx.hqx
  1091.   You can also use any of its mirror sites.
  1092.  
  1093. - World Wide Web
  1094.   The GSL is available, behind the editor's home-page, at:
  1095.       http://www.bio.vu.nl/home/rgaros/gestalt/
  1096.   It is also available, together with other Macintosh FAQs, at:
  1097.       http://www.astro.nwu.edu/lentz/mac/faqs/source/gestalt.html
  1098.   Also, on the Apple WWW site in:
  1099.        http://www.info.apple.com/cgi-bin/lister-pl?Apple.Support.Area/
  1100.          Developer_Services/Tool_Chest/OS_Utilities
  1101.  
  1102. - America OnLine
  1103.   You can find the GSL on AOL in the "MDV/Documents and Proposals" directory.
  1104.  
  1105. - AppleLink
  1106.   The GSL can be found on AppleLink at this location:
  1107.  
  1108.   Developer Support:Developer Services:Tool Chest:OS/Toolbox:
  1109.  
  1110. - CompuServe members can find it at the Macintosh Developers Forum
  1111.   (GO MACDEV) in the Tools/Debuggers (13) section.
  1112.   Or use the Internet locations by using GO INTERNET.
  1113.  
  1114. - eWorld
  1115.   You can find the GSL on eWorld in this location:
  1116.  
  1117.   Apple Developer Services:Tool Chest:OS/Toolbox:
  1118.  
  1119.   The shortcut to Apple Developer Services is 'devservice'.
  1120.  
  1121. - CD-ROM
  1122.   The GSL is included, with permission, on the CD-ROM titles listed below.
  1123.   You can find the GSL on the latest release or upcoming release of these
  1124.   CD-ROM titles.
  1125.       Apprentice CD-ROM                    (Celestin Company)
  1126.       BBS in a BOX CD-ROM                  (Arizona Macintosh Users Group)
  1127.       Bookmark CD                          (Apple Computer, Inc.)
  1128.       CodeWarrior CD                       (MetroWerks Corporation)
  1129.       Developer CD Series, Tool Chest      (Apple Computer, Inc.)
  1130.       Info-Mac CD-ROM                      (Pacific HiTech, Inc.)
  1131.       MacHack CD                           (MacTech Magazine)
  1132.       The Right Stuffed CD-ROM             (Quantum Leap Technologies, Inc.)
  1133.  
  1134. - Subscribers of the maillist have received their copy already.
  1135.   If you want to join this list you need to send a request to:
  1136.       gestalt-selectors-list-request@bio.vu.nl
  1137.   with in the subject line 'subscribe'. You will then also receive
  1138.   several updates before the next version is released. This list is
  1139.   only for distribution, not for discussion.
  1140.  
  1141. Contributions (new info, remarks, etc.) for the list can be send to:
  1142.       gestalt-selectors-list@bio.vu.nl
  1143.  
  1144. Please, be aware that it may take a couple of days before the new version
  1145. is available at all these locations. It is available immediatly by using
  1146. the mail archive server.
  1147.  
  1148. Beside a large number of new and changed selectors, these are the major
  1149. changes since the previous version:
  1150.  
  1151. ***************************************************************************
  1152. Paul Cunningham (Teknosys, Inc.) mentioned a number of problems with some
  1153. Third Party selectors.
  1154.  
  1155. Nobu Toge found that IM OS Utilities contains an error regarding the
  1156. selector function. This was confirmed by Steve Ko (from Apple).
  1157.  
  1158. Anonymous contributors provided information about the PB 190 and PB 5300
  1159. as well as System Update 2.0 Seed 6.
  1160.  
  1161. Includes information from the August Developer CD and of the ETO 18
  1162. Gestalt header file.
  1163. Also info from the Developer Notes regarding the PB190, PB2300, PB5300 and
  1164. PB500 PPC Upgrade Card.
  1165.  
  1166. And lots more:
  1167.  
  1168. Added selectors
  1169.     Apple System  : ag_v, pccd, pwky
  1170.     Apple Add.    : mtlk
  1171.     Third Parties : Kals, SCom, SKey
  1172. Added unknown
  1173.     Apple Softw.  : ATI , blck, hrad, irhk, pclk, puir, pwtr, SNKR, srad,
  1174.                     sysu, valk
  1175.     Third Parties : Aarn, Aarp, Aaru, Copl, HPKb, LLSM, TRSN, VrkG, VrkS,
  1176.                     VrkU
  1177. Changed selectors
  1178.     Apple System  : aslm, cput, fnd , fnd^, mach, powr, sdev, snhw, te  ,
  1179.                     teat, tsma, tsmv, via1, via2
  1180.     Apple Add.    : tmTV
  1181.     Third Parties : -
  1182. Changed unknown
  1183.     Apple Softw.  : EM20, fndx, pxtn, serh
  1184.     Third Parties : -
  1185. Previously unknown
  1186.     Apple System  : -
  1187.     Apple Add.    : q3vr
  1188.     Third Parties : CHSR
  1189. Includes updates 3.0.1 up to and including 3.0.7, sent to subscribers of
  1190. the mailing list.
  1191.  
  1192. ***************************************************************************
  1193.  
  1194.  
  1195. Best regards,
  1196. Rene Ros
  1197. rgaros@bio.vu.nl
  1198.  
  1199.  
  1200.  
  1201. -- 
  1202.   Rene G.A. Ros                                               rgaros@bio.vu.nl
  1203.   Amsterdam, The Netherlands                 http://www.bio.vu.nl/home/rgaros/
  1204. - ------------------------------------------------------------------------------
  1205.   HOMO SAPIENS NON URINAT IN VENTUM
  1206.  
  1207. +++++++++++++++++++++++++++
  1208.  
  1209. >From jwbaxter@olympus.net (John W. Baxter)
  1210. Date: Tue, 03 Oct 1995 14:18:14 -0700
  1211. Organization: Internet for the Olympic Peninsula
  1212.  
  1213. In article <44paqb$hct@balaena.bio.vu.nl>, rgaros@bio.vu.nl (Rene G.A.
  1214. Ros) wrote:
  1215.  
  1216. > Today I released version 3.1 of the
  1217. >                        Gestalt Selectors List (GSL)
  1218.  
  1219.  
  1220. This labor of love by Rene' is an essential part of one's collection of
  1221. tools, IMHO.  --John
  1222.  
  1223. -- 
  1224. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1225.        Go, Ms!
  1226.    jwbaxter@pt.olympus.net
  1227.  
  1228. ---------------------------
  1229.  
  1230. >From ddenson@nando.net (ddenson)
  1231. Subject: Help with UniversalProcPtrs
  1232. Date: 4 Oct 1995 16:42:10 -0400
  1233. Organization: NandO.net
  1234.  
  1235. I am using Think C++ 7.0.4 (Upgraded over the course of a couple years from
  1236. 6.0), and have run into a problem with UPPs.
  1237.  
  1238. Being interested in doing a project using the QuickTime Music 
  1239. Architecture, I tried compiling some projects I found on the develop 22 CD,
  1240. and it would seem that I am missing some files involving UniversalProcPtr:
  1241.  
  1242.  
  1243. Am I missing something?  A search of the standard include files with 
  1244. Symantec's distribution never mentions this beast.  However, all the 
  1245. Quicktime headers on the CD reference it.  What else do I need?
  1246.  
  1247. Please note that I am a relative newbie to this kind o' thing.  I 
  1248. understand what a UPP is (I still have a 68K Mac, however), but can't find
  1249. that one last include file...
  1250.  
  1251. Thanks,
  1252. Dave
  1253.  
  1254.  
  1255.  
  1256.  
  1257. +++++++++++++++++++++++++++
  1258.  
  1259. >From tim@dierks.org (Tim Dierks)
  1260. Date: Thu, 05 Oct 1995 01:56:04 -0700
  1261. Organization: Best Internet Communications
  1262.  
  1263. In article <44urj2$hot@parsifal.nando.net>, ddenson@nando.net (ddenson) wrote:
  1264. >Being interested in doing a project using the QuickTime Music 
  1265. >Architecture, I tried compiling some projects I found on the develop 22 CD,
  1266. >and it would seem that I am missing some files involving UniversalProcPtr:
  1267. >
  1268. >Am I missing something?  A search of the standard include files with 
  1269. >Symantec's distribution never mentions this beast.  However, all the 
  1270. >Quicktime headers on the CD reference it.  What else do I need?
  1271.  
  1272. The Universal Interfaces is a complete set of Mac headers which is
  1273. UPP-aware (among other changes). It may or may not have come with your
  1274. Symantec C. If not, they're available at:
  1275.  
  1276. <ftp://ftp.info.apple.com/Apple.Support.Area/Developer_Services/Tool_Chest/Inter
  1277. faces/Universal_Interfaces.sit.hqx>
  1278.  
  1279. Enjoy,
  1280.  - Tim
  1281.  
  1282. -- 
  1283. Tim Dierks - Software Haruspex - tim@dierks.org
  1284. If you can't lick 'em, stick 'em on with a big piece of tape. - Negativland
  1285.  
  1286. +++++++++++++++++++++++++++
  1287.  
  1288. >From larry_kearney@appsig.com (Lawrence Kearney)
  1289. Date: Thu, 05 Oct 1995 20:53:42 -0700
  1290. Organization: Applied Signal Technology
  1291.  
  1292. In article <44urj2$hot@parsifal.nando.net>, ddenson@nando.net (ddenson) wrote:
  1293.  
  1294. > Being interested in doing a project using the QuickTime Music 
  1295. > Architecture, I tried compiling some projects I found on the develop 22 CD,
  1296. > and it would seem that I am missing some files involving UniversalProcPtr:
  1297. > Am I missing something?  A search of the standard include files with 
  1298. > Symantec's distribution never mentions this beast.  However, all the 
  1299. > Quicktime headers on the CD reference it.  What else do I need?
  1300. > Dave
  1301.  
  1302. In the Think C++ folder, you should find one titled "Mac #includes". In this
  1303. folder should be another titled "Universal Headers". The definition you
  1304. are looking for is defined in either "Types.h" or "MixedMode.h".
  1305.  
  1306. You usually should have to explicitly define this as these files are
  1307. defined in the Think C pre-compiled header list (unless you're not using
  1308. this or you've redefined it).
  1309.  
  1310. -- 
  1311. Larry Kearney                   |   "You want fries with that?"
  1312. Applied Signal Technology       |
  1313. larry_kearney@appsig.com        |
  1314.  
  1315. ---------------------------
  1316.  
  1317. >From yichena@ifi.uio.no (Yicheng An)
  1318. Subject: How to detect if the cap-lock is on?
  1319. Date: 3 Oct 1995 13:31:01 +0100
  1320. Organization: Dept. of Informatics, University of Oslo, Norway
  1321.  
  1322.  
  1323. Hi, 
  1324.  
  1325. I wonder how to detect if the cap-lock is on? anyway?
  1326.  
  1327. Thanks,
  1328.  
  1329. Yicheng
  1330.  
  1331.  
  1332. +++++++++++++++++++++++++++
  1333.  
  1334. >From jonpugh@netcom.com (Jon Pugh)
  1335. Date: Tue, 3 Oct 1995 21:42:16 GMT
  1336. Organization: Will hack for food
  1337.  
  1338. Yicheng An (yichena@ifi.uio.no) wrote:
  1339.  
  1340. > I wonder how to detect if the cap-lock is on? anyway?
  1341.  
  1342. Use GetKeys.
  1343.  
  1344. Jon
  1345.  
  1346.  
  1347.  
  1348. +++++++++++++++++++++++++++
  1349.  
  1350. >From crudolph@direct.ca (Chris Rudolph)
  1351. Date: Tue, 03 Oct 1995 15:38:15 -0800
  1352. Organization: Motion Works Group Limited
  1353.  
  1354. In article <jonpughDFw6yH.3sz@netcom.com>, jonpugh@netcom.com (Jon Pugh) wrote:
  1355.  
  1356. > Yicheng An (yichena@ifi.uio.no) wrote:
  1357. > > I wonder how to detect if the cap-lock is on? anyway?
  1358. > Use GetKeys.
  1359. > Jon
  1360.  
  1361. Why not just look at your keyboard and see if the cap lock is green.
  1362.  
  1363. GRIN...
  1364.  
  1365. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1366. Chris Rudolph
  1367. Senior Software Engineer, Technology Works.
  1368. Motion Works Group Limited
  1369.  
  1370. 130 - 1020 Mainland St, Vancouver, B.C., Canada.  V6B 2T4
  1371. Telephone:    604-685-9975.
  1372. Fax:             604-685-6105.
  1373.  
  1374. Internet:  crudolph@direct.ca
  1375. AppleLink: D2276 ( Subject: Attn: Chris Rudolph )
  1376. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1377.  
  1378. +++++++++++++++++++++++++++
  1379.  
  1380. >From dchron@prometheus.hol.gr (Dennis Chronopoulos)
  1381. Date: Wed, 04 Oct 1995 07:55:58 +0300
  1382. Organization: Student
  1383.  
  1384. In article <44rae5$hdi@hnoss.ifi.uio.no>, yichena@ifi.uio.no (Yicheng An) wrote:
  1385.  
  1386. > I wonder how to detect if the cap-lock is on? anyway?
  1387.  
  1388. You can use the following Pascal function to determine if the Caps-Lock
  1389. key is on or off.
  1390.  
  1391.  
  1392.  Function CapsLockIsOn: boolean;
  1393.   Const
  1394.    CapsKeysCode = 57;
  1395.   Var
  1396.    kbState: KeyMap;
  1397.  Begin
  1398.   GetKeys(kbState);
  1399.   CapsLockIsOn := kbState[CapsKeysCode];
  1400.  End;
  1401.  
  1402.  
  1403. I hope that this helps you.
  1404.  
  1405. Dennis
  1406.  
  1407. _______________
  1408. dchron@prometheus.hol.gr
  1409. Dennis Chronopoulos
  1410. Kifissia, Athens, Greece
  1411.  
  1412. +++++++++++++++++++++++++++
  1413.  
  1414. >From carl.gustafson@ece.drexel.edu (Carl Gustafson)
  1415. Date: 4 Oct 1995 12:21:04 GMT
  1416. Organization: Imaging and Computer Vision Center, Drexel University
  1417.  
  1418. In article <44rae5$hdi@hnoss.ifi.uio.no>, yichena@ifi.uio.no (Yicheng An) wrote:
  1419.  
  1420. > Hi, 
  1421. > I wonder how to detect if the cap-lock is on? anyway?
  1422. > Thanks,
  1423. > Yicheng
  1424.  
  1425. boolean CapsLockDown (void)
  1426. {
  1427.       KeyMap   theKeys;
  1428.    
  1429.    GetKeys (&theKeys);
  1430.    return BitTst (&theKeys,62);  // 62 is offset for caps lock key in KeyMap
  1431. }
  1432.  
  1433. -- 
  1434. Carl Gustafson
  1435. Imaging and Computer Vision Center
  1436. Drexel University, Philadelphia, Penna
  1437. - ----------------------------------------------------------
  1438. I don't speak for Drexel, and Drexel doesn't listen to me...
  1439.  
  1440. +++++++++++++++++++++++++++
  1441.  
  1442. >From reed@medicine.wustl.edu (Thomas Reed)
  1443. Date: Thu, 05 Oct 1995 09:05:53 -0500
  1444. Organization: Washington University
  1445.  
  1446. In article <44rae5$hdi@hnoss.ifi.uio.no>, yichena@ifi.uio.no (Yicheng An) wrote:
  1447.  
  1448. >I wonder how to detect if the cap-lock is on? anyway?
  1449.  
  1450. There are a couple ways.  One is to use GetKeys, but I've found that's
  1451. more trouble than it's worth.  Another way to do it is to use EventAvail
  1452. to get a pending nullEvent and examine the event.modifiers field.  Since
  1453. there are always nullEvents bouncing around the system, and EventAvail
  1454. doesn't remove the event from the queue, this works quite well for me...
  1455.  
  1456. -Thomas
  1457.  
  1458. =====================================================
  1459. Thomas Reed                     Washington University
  1460. reed@visar.wustl.edu               Medical School
  1461. reed@medicine.wustl.edu            Saint Louis, MO
  1462. http://medinfo.wustl.edu/~reed
  1463. - ---------------------------------------------------
  1464. Clothes make the man.  Naked people have little or no
  1465. influence on society.  -- Mark Twain
  1466. =====================================================
  1467.  
  1468. Opinions posted are not the opinions of Wash. U.
  1469.  
  1470. ---------------------------
  1471.  
  1472. >From hellstrm@jaguNET.com (Ben Hellstrom)
  1473. Subject: How to tell if a volume is busy ?
  1474. Date: Sat, 07 Oct 1995 05:30:53 -0400
  1475. Organization: jaguNET Access Services
  1476.  
  1477. Howdy.
  1478.  
  1479. I need a hint.  How does one tell whether a mounted volume is busy? 
  1480. Obviously I could Eject it and see if I get a fBsyErr, but if there are no
  1481. files busy this has the unfortunate side-effect of ejecting the volume.
  1482.  
  1483. I traversed the VCB buffer and pulled the vcbAtrb of the affected volume
  1484. but it seems to be bogus.  According to IM "Files" 2-79, bit 6 of vcbAtrb
  1485. should be set if the volume is busy.  The only problem is that vcbAtrb
  1486. seems to always be 0x0000 regardless of whether I have files open on the
  1487. volume or not.
  1488.  
  1489. TIA.
  1490.  
  1491. -- 
  1492. Ben Hellstrom
  1493. hellstrm@jaguNET.com
  1494.  
  1495. +++++++++++++++++++++++++++
  1496.  
  1497. >From steve@mindvision.com (Steve Kiene)
  1498. Date: Sat, 07 Oct 1995 08:21:27 -0700
  1499. Organization: MindVision Software
  1500.  
  1501. In article <hellstrm-0710950530530001@brian.jagunet.com>,
  1502. hellstrm@jaguNET.com (Ben Hellstrom) wrote:
  1503.  
  1504. > Howdy.
  1505. > I need a hint.  How does one tell whether a mounted volume is busy? 
  1506. > Obviously I could Eject it and see if I get a fBsyErr, but if there are no
  1507. > files busy this has the unfortunate side-effect of ejecting the volume.
  1508. > I traversed the VCB buffer and pulled the vcbAtrb of the affected volume
  1509. > but it seems to be bogus.  According to IM "Files" 2-79, bit 6 of vcbAtrb
  1510. > should be set if the volume is busy.  The only problem is that vcbAtrb
  1511. > seems to always be 0x0000 regardless of whether I have files open on the
  1512. > volume or not.
  1513.  
  1514. I believe the busy bit in vcbAtrb is only valid for MFS volumes. What are
  1515. you trying to accomplish here? Any mounted HFS disk should have open files
  1516. (Desktop, etc).
  1517.  
  1518. Steve Kiene
  1519. MindVision Software
  1520. File System Nerd
  1521.  
  1522. +++++++++++++++++++++++++++
  1523.  
  1524. >From jumplong@aol.com (Jump Long)
  1525. Date: 7 Oct 1995 14:01:45 -0400
  1526. Organization: America Online, Inc. (1-800-827-6364)
  1527.  
  1528. Ben Hellstrom wrote:
  1529. >I need a hint.  How does one tell whether a mounted volume is
  1530. >busy?  Obviously I could Eject it and see if I get a fBsyErr,
  1531. >but if there are no files busy this has the unfortunate
  1532. >side-effect of ejecting the volume.
  1533.  
  1534. Ben, what are you trying to accomplish?
  1535.  
  1536. If you're just trying to find out if the volume can be unmounted, then
  1537. that's not really possible. You might think you could check for open
  1538. files, but there are files opened on a volume (for example: the catalog
  1539. and extents overflow files opened by the HFS file system, the Desktop
  1540. Manager files, the AppleShare PDS file) that are automatically closed by
  1541. the system when a volume is unmounted. You really just have to try Unmount
  1542. and see if you get a fBsyErr error back.
  1543.  
  1544. If you're trying to accomplish something else, let us know.
  1545.  
  1546. - Jim Luther
  1547.  
  1548. ---------------------------
  1549.  
  1550. >From .nerd. <ajmarks@ucdavis.edu>
  1551. Subject: Killed By Update Events (again)
  1552. Date: 3 Oct 1995 03:29:45 GMT
  1553. Organization: UCD
  1554.  
  1555. Okay, so I am a new mac programmer, so flame me now.  I am writing a
  1556. small app with just one window and for some reason it gets update events
  1557. constantly; I mean I have yet to receive one null event.  As far as my
  1558. understanding goes, an update event is sent to an app if one of its
  1559. windows has a nonempty update region.  Is having another window drawn
  1560. over the contents of the window in question the only thing that will put
  1561. something in the updateRgn?
  1562.  
  1563. Thanks for your help.
  1564. Adam Marks
  1565.  
  1566. +++++++++++++++++++++++++++
  1567.  
  1568. >From larry_kearney@appsig.com (Lawrence Kearney)
  1569. Date: Wed, 04 Oct 1995 03:40:20 -0700
  1570. Organization: Applied Signal Technology
  1571.  
  1572. In article <44qan9$k7g@mark.ucdavis.edu>, .nerd. <ajmarks@ucdavis.edu> wrote:
  1573.  
  1574. > Okay, so I am a new mac programmer, so flame me now.  I am writing a
  1575. > small app with just one window and for some reason it gets update events
  1576. > constantly; I mean I have yet to receive one null event.  As far as my
  1577. > understanding goes, an update event is sent to an app if one of its
  1578. > windows has a nonempty update region.  Is having another window drawn
  1579. > over the contents of the window in question the only thing that will put
  1580. > something in the updateRgn?
  1581. > Thanks for your help.
  1582. > Adam Marks
  1583.  
  1584. You need to make sure that you have called BeginUpdate(...) and
  1585. EndUpdate(...) before and after your call to your updating code. These
  1586. calls are the only way the system has of knowing you have handled the
  1587. update event. Until this is done, it will continue to send you the update
  1588. events.
  1589.  
  1590.  
  1591.    switch ( eventType )
  1592.    {
  1593.       case updateEvt:
  1594.          BeginUpdate( (WindowPtr)event->message );
  1595.             MyHandleUpdateEvent( ... );
  1596.          EndUpdate( (WindowPtr)event->message );
  1597.          break;
  1598.  
  1599.       ...
  1600.    }
  1601.  
  1602. -- 
  1603. Larry Kearney                   |   "You want fries with that?"
  1604. Applied Signal Technology       |
  1605. larry_kearney@appsig.com        |
  1606.  
  1607. +++++++++++++++++++++++++++
  1608.  
  1609. >From vision@cc.swarthmore.edu (Frank Durgin, et al.)
  1610. Date: Tue, 03 Oct 1995 14:34:49 -0400
  1611. Organization: Swarthmore Visual Perception Lab
  1612.  
  1613. In article <44qan9$k7g@mark.ucdavis.edu>, .nerd. <ajmarks@ucdavis.edu> wrote:
  1614.  
  1615. > Okay, so I am a new mac programmer, so flame me now.  I am writing a
  1616. > small app with just one window and for some reason it gets update events
  1617. > constantly; I mean I have yet to receive one null event.  As far as my
  1618. > understanding goes, an update event is sent to an app if one of its
  1619. > windows has a nonempty update region.  Is having another window drawn
  1620. > over the contents of the window in question the only thing that will put
  1621. > something in the updateRgn?
  1622.  
  1623.  
  1624. Do you do anything with the update event? If you keep ignoring it, the OS
  1625. will keep sending it to you.
  1626.  
  1627. Ta,
  1628.         -Stephen
  1629.  
  1630. -- 
  1631. Frank Durgin & various student (and recent alumna/us) researchers
  1632. - --------------------------
  1633. Visual Perception Laboratory
  1634. Department of Psychology
  1635. Swarthmore College
  1636.  
  1637. +++++++++++++++++++++++++++
  1638.  
  1639. >From kurisuto@babel.ling.upenn.edu (Sean Crist)
  1640. Date: 4 Oct 1995 11:49:02 GMT
  1641. Organization: University of Pennsylvania
  1642.  
  1643. In article <44qan9$k7g@mark.ucdavis.edu>, .nerd.  <ajmarks@ucdavis.edu> wrote:
  1644. >Okay, so I am a new mac programmer, so flame me now.  I am writing a
  1645. >small app with just one window and for some reason it gets update events
  1646. >constantly; I mean I have yet to receive one null event.  As far as my
  1647. >understanding goes, an update event is sent to an app if one of its
  1648. >windows has a nonempty update region.  Is having another window drawn
  1649. >over the contents of the window in question the only thing that will put
  1650. >something in the updateRgn?
  1651.  
  1652. When you get your updateEvt, do you call beginUpdate, then do your drawing,
  1653. and then call endUpdate?  This is the right way to handle an UpdateEvt.
  1654. BeginUpdate sets the clipping region for the window so that you only draw
  1655. the parts that have been invalidated; EndUpdate zeroes out the updateRgn so
  1656. that you don't get the same UpdateEvt next time around.
  1657.  
  1658. If you _don't_ call BeginUpdate/EndUpdate, your updateRgn will never be
  1659. zeroed out, and you will keep getting UpdateEvts instead of null events.
  1660.  
  1661. One other point: you ask if the updateRgn is only added to in response to a
  1662. window being drawn on top of the window.  No; there's at least two other
  1663. times that come to mind.  One is when you first make your window visible;
  1664. the entire content area will be invalid.  
  1665.  
  1666. The second is when you call InvalRect or InvalRgn on some part of your
  1667. window yourself.  Well-structured Mac programs do lots and lots of this;
  1668. except for unusual cases (e.g. repeatedly drawing the outline of an object
  1669. the user's dragging), you can do _all_ of your drawing in response to
  1670. updateEvts.
  1671.  
  1672.   \/ __ __    _\_     --Sean Crist  (kurisuto@unagi.cis.upenn.edu)
  1673.  ---  |  |    \ /     For a free copy of the Bill of Rights, finger
  1674.   _| ,| ,|   -----    this account.  It's also available through
  1675.   _| ,| ,|    [_]     my homepage:
  1676.    |  |  |    [_]     http://babel.ling.upenn.edu/~kurisuto/homepage.html
  1677.  
  1678.  
  1679.  
  1680.  
  1681. +++++++++++++++++++++++++++
  1682.  
  1683. >From reed@medicine.wustl.edu (Thomas Reed)
  1684. Date: Wed, 04 Oct 1995 15:19:20 -0500
  1685. Organization: Washington University
  1686.  
  1687. In article <44qan9$k7g@mark.ucdavis.edu>, .nerd. <ajmarks@ucdavis.edu> wrote:
  1688.  
  1689. >Okay, so I am a new mac programmer, so flame me now.  I am writing a
  1690. >small app with just one window and for some reason it gets update events
  1691. >constantly;
  1692.  
  1693. Probably, when you handle the update event, you are not calling
  1694. BeginUpdate or EndUpdate.  You must bracket your update-handling code with
  1695. a call to these routines, or the event will just swing around again and
  1696. hit you in the face.
  1697.  
  1698. E.g.:
  1699.  
  1700. BeginUpdate(someWindow);
  1701. // do your update stuff here
  1702. EndUpdate(someWindow);
  1703.  
  1704. -Thomas
  1705.  
  1706. =====================================================
  1707. Thomas Reed                     Washington University
  1708. reed@visar.wustl.edu               Medical School
  1709. reed@medicine.wustl.edu            Saint Louis, MO
  1710. http://medinfo.wustl.edu/~reed
  1711. - ---------------------------------------------------
  1712. Clothes make the man.  Naked people have little or no
  1713. influence on society.  -- Mark Twain
  1714. =====================================================
  1715.  
  1716. Opinions posted are not the opinions of Wash. U.
  1717.  
  1718. +++++++++++++++++++++++++++
  1719.  
  1720. >From Carl R. Osterwald <carl_osterwald@nrel.gov>
  1721. Date: 4 Oct 1995 15:42:50 GMT
  1722. Organization: National Renewable Energy Laboratory
  1723.  
  1724. In article <44qan9$k7g@mark.ucdavis.edu> .nerd., ajmarks@ucdavis.edu
  1725. writes:
  1726.  
  1727. >Is having another window drawn
  1728. >over the contents of the window in question the only thing that will put
  1729. >something in the updateRgn?
  1730.  
  1731. This is the short list of things that a window's updateRgn non-empty,
  1732. i.e. generate update events:
  1733.  
  1734. 1)  Another window in front of the window in question that is moved or
  1735. closed, causing some portion of your window to need redrawing.
  1736.  
  1737. 2)  Creating the window.
  1738.  
  1739. 3)  Calling InvalRgn() or InvalRect() to force some portion of the
  1740. window to be invalid.
  1741.  
  1742. ---------------------------
  1743.  
  1744. >From grs124@psu.edu (Greg Simon)
  1745. Subject: Making TextEdit field a one-liner
  1746. Date: 28 Sep 1995 22:47:31 GMT
  1747. Organization: Penn State University
  1748.  
  1749.  
  1750. I have created a dialog box (using ResEdit) with some TextEdit fields. I
  1751. want to restrict these fields to a single line, and have the carrage
  1752. return apply to the 'OK' button on my dialog box (with the thick outline).
  1753. Instread, the default is multiple-line textedit fields and the OK button
  1754. (which is #1) is not double-outlined.
  1755.  
  1756. How do I do this?
  1757.  
  1758. -- 
  1759. Greg Simon <grs124@psu.edu>
  1760. Electrical Engineering Graduate Student
  1761. Newton Developer 
  1762. Penn State University
  1763.  
  1764. +++++++++++++++++++++++++++
  1765.  
  1766. >From dstone@chem.utoronto.ca (David Stone)
  1767. Date: Fri, 29 Sep 1995 12:54:51 GMT
  1768. Organization: University of Toronto Chemistry
  1769.  
  1770. In article <grs124-2809951847450001@ppp114.cac.psu.edu>, grs124@psu.edu
  1771. (Greg Simon) wrote:
  1772. > I have created a dialog box (using ResEdit) with some TextEdit fields. I
  1773. > want to restrict these fields to a single line, and have the carrage
  1774. > return apply to the 'OK' button on my dialog box (with the thick outline).
  1775. > Instread, the default is multiple-line textedit fields and the OK button
  1776. > (which is #1) is not double-outlined.
  1777. > How do I do this?
  1778.  
  1779. Define a filter proc for ModalDialog that checks for keyDown events.  If
  1780. the
  1781. character is the return or enter key, return true from the filter proc
  1782. after setting the item hit to the appropriate value (1 for the default
  1783. button).  Any other characters you don't want, ignore.  Note that you
  1784. may want to handle command-keys as well such as cut, copy, paste - if
  1785. these come through you can call DlgCut, DlgCopy, etc.
  1786.  
  1787. Here's an example - first part is the filter proc, rest is code called
  1788. by it.  
  1789.  
  1790. Dave Stone
  1791.  
  1792.  
  1793. pascal Boolean CheckEditDlgFilter(DialogPtr theDlg,EventRecord
  1794. *theEvent,short *itemHit)
  1795. {
  1796. Boolean isHandled;
  1797.  
  1798.         isHandled = CheckForEditItem(theDlg,theEvent);
  1799.                 
  1800.         if(!isHandled) {                                                //      Check for CR or ETX
  1801.                 isHandled = CheckForEnterKey(theDlg,theEvent);
  1802.                 if(isHandled == TRUE)                                   //      True - set itemHit to default
  1803.                                 *itemHit = 1;
  1804.         }
  1805.         
  1806.         if(!isHandled) {                                                //      Check for cancel event (cmd-period, esc, etc.)
  1807.                 isHandled = CheckForCancel(theDlg,theEvent);
  1808.                 if(isHandled == TRUE)                                   //      True - assume 2 = cancel button
  1809.                                 *itemHit = 2;   
  1810.         }
  1811.         
  1812.         return(isHandled);
  1813. }
  1814.  
  1815.  
  1816. Boolean CheckForEditItem(DialogPtr theDlg,EventRecord *theEvent)
  1817. {
  1818. Boolean isHandled;
  1819. char    ch;
  1820.  
  1821.         isHandled = FALSE;
  1822.         
  1823.         if(theEvent->what == keyDown || theEvent->what == autoKey) {
  1824.                 if(theEvent->modifiers & cmdKey) {
  1825.                         ch = (theEvent->message & charCodeMask);
  1826.                         isHandled = TRUE;
  1827.                         if(ch == 'c' || ch == 'C') DlgCopy(theDlg);
  1828.                         else if(ch == 'x' || ch == 'X') DlgCut(theDlg);
  1829.                         else if(ch == 'v' || ch == 'V') DlgPaste(theDlg);
  1830.                         else if(ch == 'b' || ch == 'B' || ch == 0x08) DlgDelete(theDlg);
  1831.                         else if(ch == 'a' || ch == 'A') DlgSelect(theDlg);
  1832.                         else isHandled = FALSE;
  1833.                 }
  1834.         }
  1835.         return (isHandled);
  1836. }
  1837.  
  1838. short DlgSelect(DialogPtr theDlg)
  1839. {
  1840. DialogPeek      dp;
  1841. short           di;
  1842.  
  1843.         dp = (DialogPeek)theDlg;
  1844.         
  1845.         if(dp->editField > 0) {
  1846.                 TESetSelect(0,32767,dp->textH);
  1847.                 di = dp->editField + 1;
  1848.         } else di = 0;
  1849.                 
  1850.         return (di);
  1851. }
  1852.  
  1853. +++++++++++++++++++++++++++
  1854.  
  1855. >From cwatson@cam.org (Chris Watson)
  1856. Date: Sun, 01 Oct 1995 14:16:52 -0400
  1857. Organization: Communications Accessibles Montreal, Quebec Canada
  1858.  
  1859. In article <grs124-2809951847450001@ppp114.cac.psu.edu>, grs124@psu.edu
  1860. (Greg Simon) wrote:
  1861.  
  1862. > I have created a dialog box (using ResEdit) with some TextEdit fields. I
  1863. > want to restrict these fields to a single line, and have the carrage
  1864. > return apply to the 'OK' button on my dialog box (with the thick outline).
  1865. > Instread, the default is multiple-line textedit fields and the OK button
  1866. > (which is #1) is not double-outlined.
  1867.  
  1868. If you are using a modal dialogue and System 7, then you can simply use
  1869. the SetDialogDefaultItem () function.  It will draw the thick border
  1870. around the button and make the return and enter keys apply to the OK
  1871. button.  Add this line somewhere after you create the dialogue:
  1872.  
  1873. SetDialogDefaultItem (dialog, ok);
  1874.  
  1875. Also, there exists SetDialogCancelItem () and SetDialogTracksCursor () to
  1876. handle the cancel button and change the cursor to an i-beam.
  1877.  
  1878. Hope that helps...
  1879.  
  1880.  
  1881. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  1882.   H H      |                   |                                       |
  1883.   | |      | Sean McBride      |                                       |
  1884. H-C-C-O-H  | cwatson@cam.org   |   "Total destructive interference"    |
  1885.   | |      | Montreal, Canada  |                                       |
  1886.   H H      |                   |                                       |
  1887. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  1888.  
  1889. ---------------------------
  1890.  
  1891. >From rpg@clark.net (Mark Kadonoff)
  1892. Subject: MixedMode Manager Routine Descriptors for SetDialogItem calls?
  1893. Date: Tue, 03 Oct 1995 14:33:53 -0500
  1894. Organization: Reprographic Products Group
  1895.  
  1896. I'm updating a Photoshop plug-in from 68K to PowerMac, and having
  1897. difficulties with procPtrs in my SetDialogItem calls. These procPtrs are
  1898. coerced as handles, and I'm unsure whether they need to be set up as
  1899. Routine Descriptors. 
  1900.  
  1901. Thanks,
  1902.  
  1903. Mark Kadonoff
  1904.  
  1905. +++++++++++++++++++++++++++
  1906.  
  1907. >From erichsen@pacificnet.net (Erichsen)
  1908. Date: Tue, 03 Oct 1995 18:13:22 -0700
  1909. Organization: Disorganized
  1910.  
  1911. In article <rpg-0310951433530001@rpg-ppp.clark.net>, rpg@clark.net (Mark
  1912. Kadonoff) wrote:
  1913.  
  1914. >I'm updating a Photoshop plug-in from 68K to PowerMac, and having
  1915. >difficulties with procPtrs in my SetDialogItem calls. These procPtrs are
  1916. >coerced as handles, and I'm unsure whether they need to be set up as
  1917. >Routine Descriptors. 
  1918.  
  1919. They do need to be routine descriptors. There's a macro that'll do it for you:
  1920.  
  1921. UserItemUPP     ItemUPP;
  1922.  
  1923. ItemUPP = NewUserItemProc( UserItemProc );
  1924.  
  1925. Then just call SetDialogItem like this:
  1926.  
  1927. SetDialogItem( dialog, item, itemType, ( Handle ) ItemUPP, &itemRect );
  1928.  
  1929. +++++++++++++++++++++++++++
  1930.  
  1931. >From vance@webgenesis.com (Vance Huntley)
  1932. Date: Wed, 04 Oct 1995 09:08:01 -0400
  1933. Organization: WebGenesis
  1934.  
  1935. In article <rpg-0310951433530001@rpg-ppp.clark.net>, rpg@clark.net (Mark
  1936. Kadonoff) wrote:
  1937.  
  1938. > I'm updating a Photoshop plug-in from 68K to PowerMac, and having
  1939. > difficulties with procPtrs in my SetDialogItem calls. These procPtrs are
  1940. > coerced as handles, and I'm unsure whether they need to be set up as
  1941. > Routine Descriptors. 
  1942. > Thanks,
  1943. > Mark Kadonoff
  1944.  
  1945. Yes, they need to be routine descriptors.  Here is an example of the
  1946. method which I have been using which should work in both 68K & PPC:
  1947.  
  1948.  
  1949. in the prototypes section:
  1950.  
  1951. pascal void DrawColorSample(DialogPtr theDialog, short item);
  1952.                          
  1953. #if USESROUTINEDESCRIPTORS
  1954.    RoutineDescriptor gDrawColorSampleRD = 
  1955.          BUILD_ROUTINE_DESCRIPTOR(uppUserItemProcInfo, DrawColorSample);
  1956. #endif
  1957.  
  1958.  
  1959.  
  1960. In the Dialog-handling function
  1961.  
  1962.    DialogPtr      theDialog = GetNewDialog(kColorsDLOG,0,(WindowPtr) -1);
  1963.  
  1964.    // set drawing procedure for the user item
  1965.    GetDialogItem( theDialog, iSample, &itemType, &itemHandle, &itemRect );
  1966. #if USESROUTINEDESCRIPTORS
  1967.       SetDialogItem( theDialog, iSample, itemType,
  1968. (Handle)&gDrawColorSampleRD, &itemRect );
  1969. #else
  1970.       SetDialogItem( theDialog, iSample, itemType, (Handle)
  1971. DrawColorSample, &itemRect );
  1972. #endif
  1973.  
  1974.  
  1975. Sort of messy with all those #if's but it works
  1976.  
  1977.  
  1978. Vance
  1979.  
  1980. -- 
  1981. Vance Huntley
  1982.  
  1983. Software Development & Technical Support
  1984. WebGenesis, Inc.
  1985. Ithaca, NY
  1986.  
  1987. 607.255.1396
  1988. - -----------
  1989. Check out our site, "The Globe"!
  1990. <http://www.webgenesis.com>  
  1991.  
  1992. ---------------------------
  1993.  
  1994. >From markwomack@aol.com (MarkWomack)
  1995. Subject: Photoshop Filter Host?
  1996. Date: 28 Sep 1995 19:44:22 -0400
  1997. Organization: America Online, Inc. (1-800-827-6364)
  1998.  
  1999. Does anyone have any examples of being a Photoshop filter host?  The docs
  2000. I have are on creating a filter.  I want information about the other end.
  2001.  
  2002. Thanks!
  2003. Mark
  2004.  
  2005. +++++++++++++++++++++++++++
  2006.  
  2007. >From triple@nando.net (Joe Zobkiw)
  2008. Date: Thu, 28 Sep 1995 22:27:37 -0400
  2009. Organization: TripleSoft Inc.
  2010.  
  2011. In article <44fc0m$e02@newsbf02.news.aol.com>, markwomack@aol.com
  2012. (MarkWomack) wrote:
  2013.  
  2014. >Does anyone have any examples of being a Photoshop filter host?  The docs
  2015. >I have are on creating a filter.  I want information about the other end.
  2016.  
  2017. I don't think there is any documentation on that. You have to figure it
  2018. out yourself from the Photoshop SDK.
  2019.  
  2020. Joe Zobkiw
  2021. President
  2022.  
  2023. - ----------------------------------------------------------------
  2024. TripleSoft Inc, Macintosh Software Development     CIS: 74631,1700
  2025. P.O. Box 30774, Raleigh, NC 27622-0774      AOL/eWorld: TripleSoft
  2026. voice/fax (919) 872-0916                Internet: Triple@nando.net
  2027. - ----------------------------------------------------------------
  2028.  Look for "A Fragment of Your Imagination" from Addison-Wesley...
  2029. PowerPC/Code Resources/Fragments/Components/Extensions/and more...
  2030.  
  2031. +++++++++++++++++++++++++++
  2032.  
  2033. >From bas@luna.nl (Bas A. Schulte)
  2034. Date: Fri, 29 Sep 1995 10:01:24 +0100
  2035. Organization: Models, Inc.
  2036.  
  2037. In article <44fc0m$e02@newsbf02.news.aol.com>, markwomack@aol.com
  2038. (MarkWomack) wrote:
  2039.  
  2040. > Does anyone have any examples of being a Photoshop filter host?  The docs
  2041. > I have are on creating a filter.  I want information about the other end.
  2042. > Thanks!
  2043. > Mark
  2044.  
  2045. Mark,
  2046.  
  2047. the only sample I've seen in source-code is NIH Image. It's available
  2048. somewhere at one of the NASA archives, I think.
  2049.  
  2050. BTW, I did this (being an acquire plug-in host), and it's tricky, but it
  2051. can be done. I used only the Adobe plug-in documentation.
  2052.  
  2053. Good luck.
  2054.  
  2055. +++++++++++++++++++++++++++
  2056.  
  2057. >From carl.gustafson@ece.drexel.edu (Carl Gustafson)
  2058. Date: 2 Oct 1995 14:02:49 GMT
  2059. Organization: Imaging and Computer Vision Center, Drexel University
  2060.  
  2061. In article <bas-2909951001240001@12-dynamic-c.rotterdam.luna.net>,
  2062. bas@luna.nl (Bas A. Schulte) wrote:
  2063.  
  2064. > the only sample I've seen in source-code is NIH Image. It's available
  2065. > somewhere at one of the NASA archives, I think.
  2066.  
  2067. The NIH-Image source code's home is (and can be ftp'd from:
  2068.  
  2069.    zippy.nimh.nih.gov
  2070.  
  2071. It is built using Metrowerks Pascal.
  2072.  
  2073. -- 
  2074. Carl Gustafson
  2075. Imaging and Computer Vision Center
  2076. Drexel University, Philadelphia, Penna
  2077. - ----------------------------------------------------------
  2078. I don't speak for Drexel, and Drexel doesn't listen to me...
  2079.  
  2080. ---------------------------
  2081.  
  2082. >From han@lava.net (Byron Han)
  2083. Subject: PowerPC handling of preloaded CODE resources?
  2084. Date: 29 Sep 1995 14:26:23 -1000
  2085. Organization: LavaNet, Inc.
  2086.  
  2087. If I have a fat binary and the CODE resources are marked preload, locked,
  2088. what happens on a PowerpC machine?  Do I need to manually
  2089. go through and unlock and purge/release all of these resources?
  2090. -- 
  2091. Byron Han, Chief Engineer * Han Chen & Son * PO Box 61557 * Honolulu HI 96839
  2092. email: han@hanchenson.com        web: http://www.hanchenson.com/~han/han.html
  2093. ISP: LavaNet, Honolulu HI
  2094.  
  2095. +++++++++++++++++++++++++++
  2096.  
  2097. >From triple@nando.net (Joe Zobkiw)
  2098. Date: Sat, 30 Sep 1995 00:04:39 -0400
  2099. Organization: TripleSoft Inc.
  2100.  
  2101. In article <44i2rf$8s5@malasada.lava.net>, han@lava.net (Byron Han) wrote:
  2102.  
  2103. >If I have a fat binary and the CODE resources are marked preload, locked,
  2104. >what happens on a PowerpC machine?  Do I need to manually
  2105. >go through and unlock and purge/release all of these resources?
  2106.  
  2107. Once would think that the resources would get loaded just as any other,
  2108. low in the heap, when the resource fork is opened. You can do a quick
  2109. check of this by dropping into MacsBug and dumping the contents of the
  2110. heap. You will probably see the CODE resources sitting there, locked.
  2111.  
  2112. Joe Zobkiw
  2113. President
  2114.  
  2115. - ----------------------------------------------------------------
  2116. TripleSoft Inc, Macintosh Software Development     CIS: 74631,1700
  2117. P.O. Box 30774, Raleigh, NC 27622-0774      AOL/eWorld: TripleSoft
  2118. voice/fax (919) 872-0916                Internet: Triple@nando.net
  2119. - ----------------------------------------------------------------
  2120.  Look for "A Fragment of Your Imagination" from Addison-Wesley...
  2121. PowerPC/Code Resources/Fragments/Components/Extensions/and more...
  2122.  
  2123. +++++++++++++++++++++++++++
  2124.  
  2125. >From english@primenet.com (Lawson English)
  2126. Date: 30 Sep 1995 05:07:57 GMT
  2127. Organization: Primenet (602)395-1010
  2128.  
  2129. Joe Zobkiw (triple@nando.net) wrote:
  2130. : In article <44i2rf$8s5@malasada.lava.net>, han@lava.net (Byron Han) wrote:
  2131.  
  2132. : >If I have a fat binary and the CODE resources are marked preload, locked,
  2133. : >what happens on a PowerpC machine?  Do I need to manually
  2134. : >go through and unlock and purge/release all of these resources?
  2135.  
  2136. : Once would think that the resources would get loaded just as any other,
  2137. : low in the heap, when the resource fork is opened. You can do a quick
  2138. : check of this by dropping into MacsBug and dumping the contents of the
  2139. : heap. You will probably see the CODE resources sitting there, locked.
  2140.  
  2141. And Heaven help you if you jump directly to it from native code....
  2142. : ------------------------------------------------------------------
  2143. : TripleSoft Inc, Macintosh Software Development     CIS: 74631,1700
  2144. : P.O. Box 30774, Raleigh, NC 27622-0774      AOL/eWorld: TripleSoft
  2145. : voice/fax (919) 872-0916                Internet: Triple@nando.net
  2146. : ------------------------------------------------------------------
  2147. :  Look for "A Fragment of Your Imagination" from Addison-Wesley...
  2148. : PowerPC/Code Resources/Fragments/Components/Extensions/and more...
  2149.  
  2150. --
  2151. - -----------------------------------------------------------------------------
  2152. Lawson English                            __  __     ____  ___       ___ ____
  2153. english@primenet.com                     /__)/__) / / / / /_  /\  / /_    /
  2154.                                         /   / \  / / / / /__ /  \/ /___  /
  2155. - -----------------------------------------------------------------------------
  2156.  
  2157. +++++++++++++++++++++++++++
  2158.  
  2159. >From sw@network-analysis-ltd.co.uk (Sak Wathanasin)
  2160. Date: Mon, 2 Oct 95 00:26:59 +0100
  2161. Organization: Network Analysis Ltd
  2162.  
  2163.  
  2164. In article <44i2rf$8s5@malasada.lava.net> (comp.sys.mac.programmer.misc), 
  2165. han@lava.net (Byron Han) writes:
  2166.  
  2167. > If I have a fat binary and the CODE resources are marked preload, locked,
  2168. > what happens on a PowerpC machine?
  2169.  
  2170. Well, they get preloaded and locked just like any other resource.
  2171. At the risk of teaching grandmothers how to suck eggs, typing
  2172. "rd -t 'CODE'" to Macsbug would have told you that...
  2173.  
  2174. Sak Wathanasin
  2175. Network Analysis Limited
  2176. 178 Wainbody Ave South, Coventry CV3 6BX, UK
  2177.  
  2178. Internet: sw@network-analysis-ltd.co.uk 
  2179. uucp:     ...!eu.britain.net!nan!sw         AppleLink: NAN.LTD
  2180. Phone: (+44) 1203 419996                    Fax: (+44) 1203 690690
  2181.  
  2182. +++++++++++++++++++++++++++
  2183.  
  2184. >From tulip@tiac.net (Ed Anson)
  2185. Date: Sun, 01 Oct 1995 23:21:10 -0400
  2186. Organization: Tulip Software
  2187.  
  2188. In article <44i2rf$8s5@malasada.lava.net>, han@lava.net (Byron Han) wrote:
  2189.  
  2190. > If I have a fat binary and the CODE resources are marked preload, locked,
  2191. > what happens on a PowerpC machine?  Do I need to manually
  2192. > go through and unlock and purge/release all of these resources?
  2193.  
  2194. Yes, this is typical of CodeWarrior generated apps. Is that what you're using?
  2195.  
  2196. You correctly surmised that the CODE resources will be unnecessarily
  2197. loaded when launching on a PowerPC machine.
  2198.  
  2199. Although Metrowerks recommends against it, my solution is to simply remove
  2200. the pre-load flag from the CODE resources. It works fine for me. Your
  2201. mileage may vary. The recommended approach is (as you guessed) to go
  2202. through and release all those loaded resources once the PowerPC code
  2203. begins execution. YUCK!
  2204.  
  2205. IHTH
  2206.  
  2207. - --------------------
  2208. Ed Anson            MediaTree: multimedia outline editor & catalog
  2209. Tulip Software
  2210. Andover, MA 01810   For details, check out my WWW page:
  2211. U.S.A.              <http://www.tiac.net/users/tulip/home.html>
  2212.  
  2213. +++++++++++++++++++++++++++
  2214.  
  2215. >From gregb@genmagic.com (Greg Branche)
  2216. Date: Mon, 02 Oct 1995 11:50:48 -0700
  2217. Organization: General Magic
  2218.  
  2219. In article <tulip-0110952321100001@tulip.tiac.net>, tulip@tiac.net (Ed
  2220. Anson) wrote:
  2221.  
  2222. >In article <44i2rf$8s5@malasada.lava.net>, han@lava.net (Byron Han) wrote:
  2223. >
  2224. >> If I have a fat binary and the CODE resources are marked preload, locked,
  2225. >> what happens on a PowerpC machine?  Do I need to manually
  2226. >> go through and unlock and purge/release all of these resources?
  2227. >
  2228. >[snip]
  2229. >Although Metrowerks recommends against it, my solution is to simply remove
  2230. >the pre-load flag from the CODE resources. It works fine for me. Your
  2231. >mileage may vary. The recommended approach is (as you guessed) to go
  2232. >through and release all those loaded resources once the PowerPC code
  2233. >begins execution. YUCK!
  2234. >
  2235.  
  2236. Unlocking and releasing all of the pre-loaded CODE resources
  2237. after-the-fact may leave gaping holes low in the heap, with locked,
  2238. immoveable resources above the holes, thereby fragmenting the heap.
  2239.  
  2240. The solution that I used for the MPW shell was to leave all CODE resources
  2241. non-preload, and have code run during initialization which manually
  2242. pre-loaded those CODE resources which were historically marked preload in
  2243. pre-3.4 shells.  By doing it yourself, you can also ensure that the heap
  2244. is properly initialized prior to sucking in all of the additional CODE
  2245. resources.  (Of course, you have to ensure that all of the initialization
  2246. code for this resides in the "Main" segment, so that no segments are
  2247. loaded dynamically.)
  2248.  
  2249. Greg Branche
  2250. Magic Cap Entomologist
  2251. General Magic, Inc.
  2252.  
  2253. ---------------------------
  2254.  
  2255. >From ramjet@hookup.net (Dave Smith)
  2256. Subject: Printing a Hairline?
  2257. Date: Fri, 29 Sep 1995 09:20:16 -0500
  2258. Organization: Westhead Consulting
  2259.  
  2260. How do I go about drawing a line that is thinner than 1 pixel (1/72 of a
  2261. inch) to the printer? Ideally this would be done in code.
  2262.  
  2263. -- 
  2264. Dave Smith                     |    "If the women don't find
  2265. Westhead Consulting            |    you handsome, they should
  2266. Etobicoke, Ontario             |     at least find you handy"
  2267. CANADA M8W 4S3                 |         - Red Green
  2268. (416) 255-3719                 |
  2269.  
  2270. +++++++++++++++++++++++++++
  2271.  
  2272. >From ronalde@softdes.se (Ronald Ek)
  2273. Date: 29 Sep 1995 16:10:43 GMT
  2274. Organization: SoftDesign
  2275.  
  2276. Hi,
  2277.  
  2278. You have to use PicComments for this. You use SetLineWidth(Point aPt)
  2279. to define the thickness of the line. It is doucumented in a technical
  2280. note from Apple.
  2281.  
  2282. I can send you some code for it if you want.
  2283.  
  2284. CU
  2285. Ronald
  2286.  
  2287. +++++++++++++++++++++++++++
  2288.  
  2289. >From pj@stacken.kth.se (Patrik Johansson)
  2290. Date: Sat, 30 Sep 1995 20:19:32 +0100
  2291. Organization: KTH
  2292.  
  2293. In article <ramjet-2909950920160001@ramjet.tor.hookup.net>,
  2294. ramjet@hookup.net (Dave Smith) wrote:
  2295.  
  2296. > How do I go about drawing a line that is thinner than 1 pixel (1/72 of a
  2297. > inch) to the printer? Ideally this would be done in code.
  2298.  
  2299. Well, PicComments will probably do it for you!
  2300.  
  2301. Pj
  2302.  
  2303. - ------------------------------------------------------------
  2304. Patrik Johansson
  2305. Royal Institute of Technology, Sweden
  2306. pj@stacken.kth.se
  2307. - ------------------------------------------------------------
  2308.  
  2309.  
  2310. +++++++++++++++++++++++++++
  2311.  
  2312. >From jybrick@jaxnet.com (John Young)
  2313. Date: 1 Oct 1995 04:40:53 GMT
  2314. Organization: Southeast Network Services, Inc.
  2315.  
  2316. In article <ramjet-2909950920160001@ramjet.tor.hookup.net>,
  2317. ramjet@hookup.net (Dave Smith) wrote:
  2318.  
  2319. > How do I go about drawing a line that is thinner than 1 pixel (1/72 of a
  2320. > inch) to the printer? Ideally this would be done in code.
  2321.  
  2322. The PicComments solution, I believe, will only work on a PostScript printer.
  2323. You could try increasing the resolution of the printer to 300x300 and scaling 
  2324. everything else larger except for your hairline.
  2325.  
  2326. It used to be PrGeneral to get and set the resolution of the printer.
  2327. I haven't had a need to do that for some time, and I don't know if there
  2328. has been a change.
  2329.  
  2330.  
  2331. See ya,
  2332. John
  2333.  
  2334. +++++++++++++++++++++++++++
  2335.  
  2336. >From aupperlm@cadvision.com (Milton Aupperle)
  2337. Date: Sat, 30 Sep 1995 16:02:07 -0700
  2338. Organization: CADVision
  2339.  
  2340. > In article <ramjet-2909950920160001@ramjet.tor.hookup.net>,
  2341. > ramjet@hookup.net (Dave Smith) wrote:
  2342. > > How do I go about drawing a line that is thinner than 1 pixel (1/72 of a
  2343. > > inch) to the printer? Ideally this would be done in code.
  2344.  
  2345. There are really 2 ways of doing it, either draw the image at the
  2346. printer's maximum printing resolution and setting up the PREC for the
  2347. printer at say 300 , 360 or 600 dpi or use the pict/postscript command to
  2348. do fractional widths. Note that the pictscript command does work with some
  2349. non - postscript printers (most 3rd part inkjets . laser writers) but not
  2350. all of them and there is no way of telling if they actually will support
  2351. it (it's up to the printer driver to do it). I find Apple flip flops on
  2352. this a lot and some versions of their non poscript printer drivers will
  2353. and other won't.
  2354.  
  2355. The postscript/pict command for fractional line weights and text rotation
  2356. can also be embedded in Pict files for import into other applications
  2357. (like macdraw, canvas etc.) too, which is sort of a bonus.
  2358.  
  2359. milton
  2360.  
  2361. +++++++++++++++++++++++++++
  2362.  
  2363. >From scouten@uiuc.edu (Eric Scouten)
  2364. Date: Sun, 01 Oct 1995 23:11:39 -0500
  2365. Organization: Huh? What's that?
  2366.  
  2367. In article <jybrick-0110950015190001@ts3-020.jaxnet.com>,
  2368. jybrick@jaxnet.com (John Young) wrote:
  2369.  
  2370. > In article <ramjet-2909950920160001@ramjet.tor.hookup.net>,
  2371. > ramjet@hookup.net (Dave Smith) wrote:
  2372. > > How do I go about drawing a line that is thinner than 1 pixel (1/72 of a
  2373. > > inch) to the printer? Ideally this would be done in code.
  2374.  
  2375. The technique is described in IM Imaging with QuickDraw, pages B-35 to
  2376. B-37. It's a little complicated and a little strange, but it does work as
  2377. advertised.
  2378.  
  2379.  
  2380. > The PicComments solution, I believe, will only work on a PostScript printer.
  2381. > You could try increasing the resolution of the printer to 300x300 and scaling 
  2382. > everything else larger except for your hairline.
  2383.  
  2384. Not entirely correct. Quoting from page B-36, "The SetLineWidth picture
  2385. comment is implemented by all PostScript LaserWriter printer drivers and
  2386. by some QuickDraw printer drivers." The text goes on to describe how the
  2387. QuickDraw LaserWriter SC driver implements the comment in its own unique
  2388. fashion, but makes no reference to the ImageWriter driver.
  2389.  
  2390. -es
  2391.  
  2392. __________________________________________________________________________
  2393. Eric Scouten                                       Constructor Constructor
  2394. scouten@metrowerks.com                                     Metrowerks, Inc.
  2395.  
  2396. To send or not to send that is the question. Whether it is nobler to risk
  2397. the flames and arrows of outraged readers, or lurk in silence and never
  2398. post inappropriately.
  2399.    -Beth Frank
  2400.  
  2401. ---------------------------
  2402.  
  2403. >From adam@park78.demon.co.uk (Adam Lloyd)
  2404. Subject: [FAQ?] Saving GWorld to PICT...
  2405. Date: Thu, 28 Sep 1995 19:35:36 +0000
  2406. Organization: a sluggish molehill.
  2407.  
  2408. I'm sure I've read about this in here before, but going back through my
  2409. archives and various technical references I've been unable to find any info
  2410. on how do to it.
  2411.  
  2412. So, is it possible to save a GWorld as a PICT file? And if so, could anyone
  2413. give me any pointers to where I can find information on this?
  2414.  
  2415. Thanks,
  2416. Adam.
  2417.  
  2418. -- 
  2419. Adam Lloyd
  2420.   SlideMan Project
  2421.   (WordSlide Maker).
  2422.  
  2423.  
  2424.  
  2425. +++++++++++++++++++++++++++
  2426.  
  2427. >From tim@dierks.org (Tim Dierks)
  2428. Date: Fri, 29 Sep 1995 02:33:23 -0700
  2429. Organization: Best Internet Communications
  2430.  
  2431. In article <AC90A98896681BCA4@park78.demon.co.uk>, adam@park78.demon.co.uk
  2432. (Adam Lloyd) wrote:
  2433.  
  2434. >I'm sure I've read about this in here before, but going back through my
  2435. >archives and various technical references I've been unable to find any info
  2436. >on how do to it.
  2437. >
  2438. >So, is it possible to save a GWorld as a PICT file? And if so, could anyone
  2439. >give me any pointers to where I can find information on this?
  2440.  
  2441. SetGWorld() to the GWorld.
  2442. Open a picture.
  2443. Use CopyBits to copy the picture data on top of itself.
  2444. Close the picture.
  2445. SetGWorld() back.
  2446.  
  2447. No bits were harmed in the making of this picture.
  2448.  
  2449.  - Tim
  2450.  
  2451. I've got to start saving these responses.
  2452.  
  2453. -- 
  2454. Tim Dierks
  2455. tim@dierks.org
  2456.  
  2457. +++++++++++++++++++++++++++
  2458.  
  2459. >From isc20357@leonis.nus.sg (PANG HEE KIANG)
  2460. Date: 30 Sep 1995 02:15:01 GMT
  2461. Organization: National University of Singapore
  2462.  
  2463.  
  2464. :1) SetGWorld() to the GWorld.
  2465. :2) Open a picture.
  2466. :3) Use CopyBits to copy the picture data on top of itself.
  2467. :4) Close the picture.
  2468. :5) SetGWorld() back.
  2469.  
  2470.  
  2471.         How slow is copying Bits to PICT compared to normal copyBits 
  2472. without writing it to a PICT ?
  2473.  
  2474.         If we changed step (3) to Copying bIts to another GWorld 
  2475. instead back to itself, are we doing 2 things at the same time ?
  2476. One to the PICT handle, another to the other GWorld.
  2477.  
  2478. Hee Kiang
  2479.  
  2480. +++++++++++++++++++++++++++
  2481.  
  2482. >From pottier@bireme.ens.fr (Francois Pottier)
  2483. Date: 1 Oct 1995 20:50:53 GMT
  2484. Organization: Ecole Normale Superieure, Paris
  2485.  
  2486. In article <44i975$gap@nuscc.nus.sg>,
  2487. PANG HEE KIANG <isc20357@leonis.nus.sg> wrote:
  2488.  
  2489. >       How slow is copying Bits to PICT compared to normal copyBits 
  2490. >without writing it to a PICT ?
  2491.  
  2492. If my understanding of picture recording is correct, when you call
  2493. OpenPicture, the QuickDraw bottlenecks are replaced with recording
  2494. routines, so calling CopyBits doesn't call the usual, trusty
  2495. CopyBits; instead it calls a routine which records the image data
  2496. into a picture. The destination bitmap is ignored.
  2497.  
  2498. Not 100% sure but it sounds logical to me...
  2499.  
  2500. -- 
  2501. Francois Pottier                                            pottier@dmi.ens.fr
  2502. - ----------------------------------------------------------------------------
  2503. Check my WWW page at http://acacia.ens.fr:8080/home/pottier/ ...
  2504.  
  2505. +++++++++++++++++++++++++++
  2506.  
  2507. >From vision@cc.swarthmore.edu (Frank Durgin, et al.)
  2508. Date: Fri, 29 Sep 1995 13:05:57 -0400
  2509. Organization: Swarthmore Visual Perception Lab
  2510.  
  2511. In article <AC90A98896681BCA4@park78.demon.co.uk>, adam@park78.demon.co.uk
  2512. (Adam Lloyd) wrote:
  2513.  
  2514. > So, is it possible to save a GWorld as a PICT file? And if so, could anyone
  2515. > give me any pointers to where I can find information on this?
  2516.  
  2517. Yep. Do something like this (you might want to chop it up into multiple
  2518. routines depending on how you will be using it; this is just more compact
  2519. since I don't have to include parameter-passing code ;)
  2520.  
  2521. OSErr MakeAndPutPictToFile(ConstStr255Param fileName, GWorldPtr
  2522. theWorld)       {
  2523.         StringPtr               volName;
  2524.         PicHandle               thePict;
  2525.         PixMapHandle            thePixmap;
  2526.         long                    count;
  2527.         unsigned char*          header;
  2528.  
  2529.         ConstStr255Param        prompt = "\pSave file as:",
  2530.                                 defaultName = "\poffscreen PICT";
  2531.         OpenCPicParams          picHeader;
  2532.         short                   refNum;
  2533.         StandardFileReply       reply;
  2534.         long                    theDirID;
  2535.         Rect                    theOffRect,thePictRect;
  2536.  
  2537.         OSErr                           myErr;
  2538.  
  2539.  
  2540.         // set up the neccessary PICT header info
  2541.         picHeader.srcRect = gMainWindow->portRect;
  2542.         picHeader.hRes = 72 << 16;
  2543.         picHeader.vRes = 72 << 16;
  2544.         picHeader.version = -2;
  2545.         
  2546.         thePixmap = GetGWorldPixmap(theWorld);
  2547.  
  2548.         // create the Pict
  2549.         //      (OpenCPicture turns on recording of QuickDraw calls)
  2550.         thePict = OpenCPicture(&picHeader);
  2551.                 // CopyBits the pixmap to itself: since we're recording draw
  2552.                 // commands, this will stuff the pixmap data into the pict
  2553.                 CopyBits((BitMapPtr) *thePixmap, (BitMapPtr) *thePixmap,
  2554.                                 &theWorld->portRect, &theWorld->portRect, 
  2555.                                 srcCopy, nil);
  2556.         ClosePicture(); // stop recording: we have the data
  2557.         
  2558.         HLock((Handle)(Handle)thePict); // lock the PicHandle down just in case
  2559.  
  2560.         // prompt for a name to save the PICT file under
  2561.         StandardPutFile(prompt, defaultName, &reply);
  2562.         // if we were successful, create the file
  2563.         if(reply.sfGood) myErr = FSpCreate(&reply.sfFile, '????',
  2564.                         'PICT', reply.sfScript);
  2565.         // and open its data fork
  2566.         //      refNum will contain the file reference number at exit.
  2567.         if(myErr == noErr)      myErr = FSpOpenDF(&spec, fsRdWrPerm, &refNum);  
  2568.         
  2569.         // generate an empty 512B header for the PICT
  2570.         header = (unsigned char*) NewPtrClear(512);
  2571.  
  2572.         // now write the actual data
  2573.         if(myErr == noErr ) { 
  2574.                 count = 512L;
  2575.                 // write the header (in this case, 512 bytes of zeros)
  2576.                 myErr = FSWrite(refNum, &count, header);
  2577.                 if(myErr == noErr) {
  2578.                         count = GetHandleSize((Handle)thePict);
  2579.                         // write the actual data
  2580.                         myErr = FSWrite(refNum, &count, *thePict);
  2581.                 }
  2582.                 myErr = FSClose( refNum );
  2583.                 // after closing up, flush the disk caches to make everything
  2584.                 // update properly
  2585.                 if(myErr == noErr)      myErr = GetVol(volName, &refNum);
  2586.                         // refNum is now the *volume* reference number:
  2587.                         //      don't get the two confused
  2588.                 if(myErr == noErr)      myErr = FlushVol(volName, refNum);
  2589.         }                              
  2590.         
  2591.         HUnlock((Handle)thePict);       // unlock the PicHandle
  2592.         KillPicture( thePict );         // and dispose of it
  2593.                         
  2594.         return(myErr);
  2595. }
  2596.  
  2597.  
  2598. Ta,
  2599.         -Stephen
  2600.  
  2601. -- 
  2602. Frank Durgin & various student (and recent alumna/us) researchers
  2603. - --------------------------
  2604. Visual Perception Laboratory
  2605. Department of Psychology
  2606. Swarthmore College
  2607.  
  2608. +++++++++++++++++++++++++++
  2609.  
  2610. >From tim@dierks.org (Tim Dierks)
  2611. Date: Tue, 03 Oct 1995 23:21:03 -0700
  2612. Organization: Best Internet Communications
  2613.  
  2614. In article <44muvd$kjf@nef.ens.fr>, pottier@bireme.ens.fr (Francois
  2615. Pottier) wrote:
  2616.  
  2617. >In article <44i975$gap@nuscc.nus.sg>,
  2618. >PANG HEE KIANG <isc20357@leonis.nus.sg> wrote:
  2619. >
  2620. >>       How slow is copying Bits to PICT compared to normal copyBits 
  2621. >>without writing it to a PICT ?
  2622. >
  2623. >If my understanding of picture recording is correct, when you call
  2624. >OpenPicture, the QuickDraw bottlenecks are replaced with recording
  2625. >routines, so calling CopyBits doesn't call the usual, trusty
  2626. >CopyBits; instead it calls a routine which records the image data
  2627. >into a picture. The destination bitmap is ignored.
  2628.  
  2629. You're correct; while drawing a picture, nothing is actually drawn.
  2630. However, making a picture will probably still be slower than drawing to
  2631. the screen, maybe much so. The data still has to be copied, after all, and
  2632. in a picture, it goes into a handle (which can cause memory manager
  2633. activity when it has to be grown, etc.) and pixel data gets compressed.
  2634.  
  2635. Also, OpenPicture() doesn't replace the bottlenecks; it just calls
  2636. HidePen(); so if you want to record and draw at the same time, you can do
  2637. it by calling ShowPen() after OpenPicture(). Note that you'll need to do a
  2638. balancing HidePen() to match the ShowPen() that ClosePicture() will do.
  2639.  
  2640.  - Tim
  2641.  
  2642. -- 
  2643. Tim Dierks - Software Haruspex - tim@dierks.org
  2644. If you can't lick 'em, stick 'em on with a big piece of tape. - Negativland
  2645.  
  2646. ---------------------------
  2647.  
  2648. >From williar2@miavx1.acs.muohio.edu (Bob Williams)
  2649. Subject: [Q] How to use SetDialogTracksCursor()
  2650. Date: 1 Oct 95 23:08:27 -0500
  2651. Organization: Enterprise Software
  2652.  
  2653. Can anyone tell me how to use SetDialogTracksCursor? I can use
  2654. SetDialogCancelItem and SetDialogDefaultItem without a problem, but not
  2655. SDTC. The cursor changes but it seems like the coordinates the system are
  2656. checking are global instead of local (i.e., the cursor changes while it is
  2657. above and to the left of where it should change). Help?
  2658.  
  2659. TIA.
  2660.  
  2661. Regards,
  2662. Bob
  2663. -- 
  2664. Robert E. Williams, Jr. | I can picture a world without war, a world
  2665. Macintosh Developer     | without hate. And I can picture us attacking
  2666. Enterprise Software     | that world, because they'd never expect it.
  2667. ______________________________________________________________________
  2668. williar2@miavx1.muohio.edu             bwilliams@mveca3.mveca.ohio.gov
  2669. rew@sefl.satelnet.org               http://miavx1.muohio.edu/~williar2
  2670.  
  2671. +++++++++++++++++++++++++++
  2672.  
  2673. >From darth@zfn.uni-bremen.de (Jochen Lippert)
  2674. Date: Mon, 02 Oct 1995 17:55:23 +0000
  2675. Organization: University of Bremen
  2676.  
  2677. In article <1995Oct1.230827@miavx1>, williar2@miavx1.acs.muohio.edu (Bob
  2678. Williams) wrote:
  2679.  
  2680. > Can anyone tell me how to use SetDialogTracksCursor? I can use
  2681. > SetDialogCancelItem and SetDialogDefaultItem without a problem, but not
  2682. > SDTC. The cursor changes but it seems like the coordinates the system are
  2683. > checking are global instead of local (i.e., the cursor changes while it is
  2684. > above and to the left of where it should change). Help?
  2685. > TIA.
  2686.  
  2687. If you set the current port to the Dialog window, all will work fine:
  2688.  
  2689. GetPort(&savePort);
  2690. SetPort(myDialog);
  2691. SetDialogTracksCursor(myDialog, true);
  2692.  
  2693. (Do Dialog stuff here)
  2694.  
  2695. SetPort(savePort);
  2696.  
  2697. HTH
  2698.  
  2699. Jochen Lippert
  2700.  
  2701. darth@zfn.uni-bremen.de
  2702.  
  2703. +++++++++++++++++++++++++++
  2704.  
  2705. >From jwwalker@electriciti.com (James W. Walker)
  2706. Date: Mon, 02 Oct 1995 21:12:34 -0700
  2707. Organization: Nisus Software
  2708.  
  2709. In article <1995Oct1.230827@miavx1>, williar2@miavx1.acs.muohio.edu (Bob
  2710. Williams) wrote:
  2711.  
  2712. > Can anyone tell me how to use SetDialogTracksCursor? I can use
  2713. > SetDialogCancelItem and SetDialogDefaultItem without a problem, but not
  2714. > SDTC. The cursor changes but it seems like the coordinates the system are
  2715. > checking are global instead of local (i.e., the cursor changes while it is
  2716. > above and to the left of where it should change). Help?
  2717.  
  2718. Is the port set correctly?  My usual sequence is:
  2719. 1. Create the dialog, but the DLOG makes it initially invisible.
  2720. 2. Call SetPort.
  2721. 3. Do SetDialogTracksCursor and other initializations.
  2722. 4. Show the dialog.
  2723. 5. Call ModalDialog.
  2724. -- 
  2725.  Jim Walker
  2726.  
  2727. ---------------------------
  2728.  
  2729. End of C.S.M.P. Digest
  2730. **********************
  2731.